/**
 * Window Smart Home - Homepage template
 * Hero, services, about, CTA band, projects, testimonials and blog sections.
 */

/* ==========================================================================
   1. Hero
   ========================================================================== */

.wsh-hero {
  --wsh-hero-inset: max(
    var(--wsh-gutter),
    calc((100vw - var(--wsh-container)) / 2)
  );
  --wsh-hero-bleed: max(0px, calc((100vw - var(--wsh-container)) / 2));
  overflow: hidden;
  background: var(--wsh-grey-50);
  border-bottom: 30px solid var(--wsh-navy);
}

.wsh-hero__inner {
  display: grid;
  gap: var(--wsh-space-12);
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  align-items: stretch;
}

.wsh-hero__content {
  min-width: 0;
  align-self: center;
  padding-block: var(--wsh-space-16);
  padding-left: var(--wsh-hero-inset);
}

.wsh-hero__title {
  display: flex;
  flex-direction: column;
  margin: 0 0 var(--wsh-space-5);
  font-size: var(--wsh-fs-h1);
  line-height: 1.12;
  background: linear-gradient(180deg, #1ba2fa 0%, #7df27a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--wsh-blue);
}

.wsh-hero__line {
  min-width: 0;
  color: inherit;
}

.wsh-hero__text {
  max-width: 34rem;
  margin-bottom: var(--wsh-space-8);
  font-size: var(--wsh-fs-lead);
  line-height: var(--wsh-lh-loose);
}

.wsh-hero__media {
  position: relative;
  min-width: 0;
  width: calc(100% + var(--wsh-hero-bleed));
  margin-right: calc(-1 * var(--wsh-hero-bleed));
}

.wsh-hero__media-primary {
  width: 100%;
  height: 100%;
  min-height: 460px;
  overflow: hidden;
}

.wsh-hero__media-primary img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wsh-hero__media-secondary {
  position: absolute;
  left: -25%;
  bottom: 4%;
  width: 100%;
  max-width: 400px;
  height: 210px;
  border-radius: var(--wsh-radius-lg);
  overflow: hidden;
  box-shadow: var(--wsh-shadow-lg);
  border: 6px solid var(--wsh-white);
  aspect-ratio: 4 / 3;
  z-index: 2;
}

.wsh-hero__media-secondary img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wsh-hero__media-accent {
  position: absolute;
  right: 8%;
  bottom: -6%;
  width: 34%;
  max-width: 240px;
  z-index: 3;
  filter: drop-shadow(0 20px 30px rgba(11, 34, 48, 0.28));
}

.wsh-hero__media-accent img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 900px) {
  .wsh-hero__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .wsh-hero__content {
    padding-inline: var(--wsh-gutter);
  }

  .wsh-hero__media {
    width: 100%;
    margin-right: 0;
    margin-top: var(--wsh-space-12);
  }

  .wsh-hero__media-primary {
    height: auto;
    min-height: 0;
    border-radius: var(--wsh-radius-lg);
    box-shadow: var(--wsh-shadow-lg);
    aspect-ratio: 6 / 7;
  }

  .wsh-hero__media-secondary {
    left: 0;
  }

  .wsh-hero__media-accent {
    right: 0;
  }
}

/* ==========================================================================
   2. Services
   ========================================================================== */

.wsh-services__grid {
  display: grid;
  gap: var(--wsh-space-6);
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1024px) {
  .wsh-services__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .wsh-services__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.wsh-service-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--wsh-space-4);
  text-align: center;
  color: inherit;
}

.wsh-service-card__media {
  display: block;
  width: 100%;
  padding: 10px;
  border-radius: var(--wsh-radius-xl);
  background: var(--wsh-white);
  box-shadow: var(--wsh-shadow-md);
}

.wsh-service-card__frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--wsh-radius-lg);
  overflow: hidden;
}

.wsh-service-card__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--wsh-transition-slow);
}

.wsh-service-card:hover .wsh-service-card__frame img {
  transform: scale(1.06);
}

.wsh-service-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(27, 162, 250, 0.55) 0%,
    rgba(125, 242, 122, 0.55) 100%
  );
  opacity: 0;
  transition: opacity var(--wsh-transition);
}

.wsh-service-card.is-active .wsh-service-card__overlay,
.wsh-service-card:hover .wsh-service-card__overlay {
  opacity: 1;
}

.wsh-service-card__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: var(--wsh-radius-circle);
  background: var(--wsh-green);
  color: var(--wsh-white);
  box-shadow: var(--wsh-shadow-md);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
  transition:
    opacity var(--wsh-transition),
    transform var(--wsh-transition);
}

.wsh-service-card.is-active .wsh-service-card__icon,
.wsh-service-card:hover .wsh-service-card__icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.wsh-service-card__title {
  font-weight: var(--wsh-fw-bold);
  color: var(--wsh-ink);
}

.wsh-service-card:hover .wsh-service-card__title {
  color: var(--wsh-blue);
}

/* ==========================================================================
   3. About
   ========================================================================== */

.wsh-about__inner {
  display: grid;
  gap: var(--wsh-space-16);
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  align-items: center;
}

.wsh-about__media {
  border-top-right-radius: 250px;
  overflow: hidden;
  box-shadow: var(--wsh-shadow-lg);
}

.wsh-about__media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-top-right-radius: 250px;
}

.wsh-about__text {
  margin-bottom: var(--wsh-space-6);
  font-size: var(--wsh-fs-lead);
  line-height: var(--wsh-lh-loose);
}

@media (max-width: 900px) {
  .wsh-about__inner {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   4. Upgrade CTA band
   ========================================================================== */

.wsh-cta {
  background: var(--wsh-gradient-navy);
}

.wsh-cta__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--wsh-space-8);
  padding-block: var(--wsh-space-12);
}

.wsh-cta__title {
  margin: 0 0 var(--wsh-space-3);
  max-width: 36rem;
  font-size: clamp(24px, calc(24px + 22 * ((100vw - 320px) / 1120)), 46px);
  background: linear-gradient(180deg, #1ba2fa 0%, #7df27a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--wsh-blue);
}

.wsh-cta__title .wsh-heading__accent {
  color: inherit;
}

.wsh-cta__text {
  margin: 0;
  max-width: 26rem;
  color: var(--wsh-on-dark-70);
}

.wsh-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--wsh-space-4);
  flex-shrink: 0;
}

/* ==========================================================================
   5. Recent projects
   ========================================================================== */

.wsh-projects__inner {
  display: grid;
  gap: var(--wsh-space-12);
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
}

.wsh-projects__text {
  margin: var(--wsh-space-5) 0 var(--wsh-space-8);
  font-size: var(--wsh-fs-lead);
  line-height: var(--wsh-lh-loose);
}

.wsh-projects__gallery {
  display: flex;
  gap: var(--wsh-space-4);
}

.wsh-projects__col {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  flex-direction: column;
  gap: var(--wsh-space-4);
}

.wsh-projects__photo {
  border-radius: var(--wsh-radius-lg);
  overflow: hidden;
  box-shadow: var(--wsh-shadow-md);
}

.wsh-projects__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Columns 1 and 3 split evenly between their two photos. */
.wsh-projects__col:nth-child(1) .wsh-projects__photo:nth-child(1) img,
.wsh-projects__col:nth-child(3) .wsh-projects__photo:nth-child(1) img {
  aspect-ratio: 13 / 20;
}

.wsh-projects__col:nth-child(1) .wsh-projects__photo:nth-child(2) img,
.wsh-projects__col:nth-child(3) .wsh-projects__photo:nth-child(2) img {
  aspect-ratio: 11 / 20;
}

/* Column 2 (middle): first photo runs tall, second photo stays short - the
   two heights are tuned to add up to the same total as columns 1 and 3. */
.wsh-projects__col:nth-child(2) .wsh-projects__photo:nth-child(1) img {
  aspect-ratio: 7 / 15;
}

.wsh-projects__col:nth-child(2) .wsh-projects__photo:nth-child(2) img {
  aspect-ratio: 5 / 6;
}

@media (max-width: 900px) {
  .wsh-projects__inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .wsh-projects__gallery {
    flex-wrap: wrap;
  }

  .wsh-projects__col {
    flex: 1 1 calc(50% - var(--wsh-space-4) / 2);
  }

  .wsh-projects__col:nth-child(2) .wsh-projects__photo:nth-child(1) img,
  .wsh-projects__col:nth-child(2) .wsh-projects__photo:nth-child(2) img {
    aspect-ratio: 13 / 20;
  }
}

/* ==========================================================================
   6. Testimonials
   ========================================================================== */

.wsh-testimonials {
  background: var(--wsh-gradient-navy);
  color: var(--wsh-on-dark-70);
  margin-top: 80px;
}

.wsh-testimonials .wsh-eyebrow {
  color: var(--wsh-green);
}

.wsh-testimonials__title {
  margin-bottom: var(--wsh-space-4);
  color: var(--wsh-white);
  font-size: var(--wsh-fs-h3);
}

.wsh-testimonials__inner {
  position: relative;
  display: grid;
  gap: var(--wsh-space-16);
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  align-items: center;
  padding-right: var(--wsh-space-10);
}

.wsh-testimonials__media {
  position: relative;
  /* Pull the photo up past the section's own top padding so it visibly
     overlaps the white area above the navy band, not just its edge. */
  margin-top: clamp(-200px, -16vw, -120px);
  align-self: start;
  border-radius: var(--wsh-radius-xl);
  overflow: hidden;
  box-shadow: var(--wsh-shadow-lg);
  aspect-ratio: 3 / 4;
}

.wsh-testimonials__photo {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--wsh-transition-slow);
}

.wsh-testimonials__photo.is-active {
  opacity: 1;
}

.wsh-testimonials__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wsh-testimonials__slides {
  position: relative;
}

.wsh-quote {
  margin: 0;
  display: none;
}

.wsh-quote.is-active {
  display: block;
}

.wsh-quote__text {
  margin: 0 0 var(--wsh-space-6);
  padding: 0;
  border: 0;
  max-width: 36.5rem;
  color: var(--wsh-white);
  font-size: var(--wsh-fs-h4);
  font-weight: var(--wsh-fw-medium);
  line-height: var(--wsh-lh-snug);
}

.wsh-quote__person {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--wsh-space-2);
}

.wsh-quote__name {
  color: var(--wsh-white);
  font-weight: var(--wsh-fw-semibold);
}

.wsh-quote__role {
  color: var(--wsh-on-dark-40);
  font-size: var(--wsh-fs-sm);
}

.wsh-testimonials__nav {
  position: absolute;
  top: 50%;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--wsh-space-6);
  transform: translateY(-50%);
}

.wsh-testimonials__dot {
  position: relative;
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: var(--wsh-radius-circle);
  background: rgba(255, 255, 255, 0.3);
  transition: background-color var(--wsh-transition);
}

.wsh-testimonials__dot.is-active {
  background: var(--wsh-green);
}

.wsh-testimonials__dot.is-active::before {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1.5px solid var(--wsh-green);
  border-radius: var(--wsh-radius-circle);
}

@media (max-width: 900px) {
  .wsh-testimonials__inner {
    grid-template-columns: 1fr;
    padding-right: 0;
  }

  .wsh-testimonials__media {
    margin-top: 0;
  }

  .wsh-testimonials__nav {
    position: static;
    flex-direction: row;
    justify-content: center;
    transform: none;
    margin-top: var(--wsh-space-8);
  }
}

/* ==========================================================================
   7. Blog
   ========================================================================== */

.wsh-blog__grid {
  display: grid;
  gap: var(--wsh-space-8);
  grid-template-columns: repeat(3, 1fr);
}

.wsh-blog-card {
  display: flex;
  flex-direction: column;
}

.wsh-blog-card__thumb {
  position: relative;
  display: block;
  border-radius: var(--wsh-radius-lg);
  overflow: hidden;
  box-shadow: var(--wsh-shadow-md);
  aspect-ratio: 4 / 3;
}

.wsh-blog-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--wsh-transition-slow);
}

.wsh-blog-card:hover .wsh-blog-card__thumb img {
  transform: scale(1.06);
}

.wsh-blog-card__meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--wsh-space-3);
  color: var(--wsh-grey-500);
  font-size: var(--wsh-fs-xs);
  font-weight: var(--wsh-fw-medium);
}

.wsh-blog-card__meta .wsh-icon {
  color: var(--wsh-blue);
}

.wsh-blog-card__body {
  padding-top: var(--wsh-space-5);
}

.wsh-blog-card__title {
  font-size: var(--wsh-fs-h5);
  margin: 0 0 var(--wsh-space-2);
}

.wsh-blog-card__title a {
  color: var(--wsh-ink);
  transition: color var(--wsh-transition);
}

.wsh-blog-card:hover .wsh-blog-card__title a {
  color: var(--wsh-blue);
}

.wsh-blog-card__excerpt {
  margin: 0 0 var(--wsh-space-4);
  color: var(--wsh-grey-500);
  font-size: var(--wsh-fs-sm);
  line-height: var(--wsh-lh-body);
}

.wsh-blog-card__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--wsh-blue);
  font-size: var(--wsh-fs-sm);
  font-weight: var(--wsh-fw-semibold);
  transition: color var(--wsh-transition);
}

.wsh-blog-card__more .wsh-icon {
  transition: transform var(--wsh-transition);
}

.wsh-blog-card__more:hover {
  color: var(--wsh-blue-dark);
}

.wsh-blog-card__more:hover .wsh-icon {
  transform: translateX(3px);
}

@media (max-width: 900px) {
  .wsh-blog__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .wsh-blog__grid {
    grid-template-columns: 1fr;
  }
}
