/**
 * CLS (Cumulative Layout Shift) fixes — preserves existing visual design.
 * Reserve space for images, carousels, fonts, and embeds before they finish loading.
 */

/* Images with width/height: keep responsive sizing, use attrs for aspect ratio only */
img[width][height] {
  height: auto;
  max-width: 100%;
}

.main-slider-five__img img[width][height] {
  height: 100%;
  max-width: none;
}

/* Hero carousel: show first slide before Owl initializes */
.main-slider-five__carousel.owl-carousel:not(.owl-loaded) {
  display: block;
}

.main-slider-five__carousel.owl-carousel:not(.owl-loaded) .item:not(:first-child) {
  display: none;
}

/* Reserve hero section height (matches .main-slider-five__item padding + content) */
.main-slider-five__item {
  min-height: 520px;
}

@media (max-width: 1199px) {
  .main-slider-five__item {
    min-height: 480px;
  }
}

@media (max-width: 991px) {
  .main-slider-five__item {
    min-height: 420px;
  }
}

/* Testimonial carousels: avoid height collapse before Owl loads */
.testimonials-one__carousel.owl-carousel:not(.owl-loaded),
.testimonials-three__carousel.owl-carousel:not(.owl-loaded) {
  display: block;
  min-height: 200px;
}

.testimonials-one__carousel.owl-carousel:not(.owl-loaded) .item:not(:first-child),
.testimonials-three__carousel.owl-carousel:not(.owl-loaded) .item:not(:first-child) {
  display: none;
}

/* Service card images: reserve consistent frame */
.service-one__item__image {
  aspect-ratio: 4 / 3;
}

.service-one__item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* About section image stack */
.about-six__img {
  min-height: 320px;
}

@media (max-width: 991px) {
  .about-six__img {
    min-height: 280px;
  }
}

/* FAQ image column */
.faq-one__img {
  min-height: 400px;
}

@media (max-width: 991px) {
  .faq-one__img {
    min-height: 0;
  }
}

/* Google Map embed — explicit height (matches .google-map iframe) */
.google-map__contact iframe.map__contact,
.google-map iframe {
  min-height: 440px;
  height: 440px;
}

/* 404 hero image */
.error-404__image img {
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 720px;
  height: auto;
  object-fit: cover;
}

/* Split-text headings: prevent collapse while GSAP initializes */
.page-header__title {
  min-height: 1.1em;
}

/* Blog listing cards */
.blog-card__image img {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.blog-details__image img {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Hide scroll-animation targets until WOW/animate initialize (no layout shift) */
.wow {
  visibility: hidden;
}

/* 404 page — helpful navigation (matches site palette, no layout impact elsewhere) */
.error-404__nav {
  margin-top: 55px;
  text-align: left;
}

.error-404__nav-title {
  font-family: var(--procounsel-heading-font, "Marcellus", serif);
  font-size: 30px;
  font-weight: 400;
  text-align: center;
  margin-bottom: 32px;
  color: var(--procounsel-primary, #19223a);
}

.error-404__cards {
  margin-bottom: 36px;
}

.error-404__card {
  display: block;
  height: 100%;
  padding: 28px 24px;
  background: var(--procounsel-white, #fff);
  border: 1px solid rgba(var(--procounsel-black-rgb, 26, 26, 26), 0.1);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.error-404__card:hover {
  border-color: var(--procounsel-base, #c7954a);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.07);
}

.error-404__card-icon {
  font-size: 34px;
  line-height: 1;
  color: var(--procounsel-base, #c7954a);
  margin-bottom: 14px;
}

.error-404__card-title {
  font-family: var(--procounsel-heading-font, "Marcellus", serif);
  font-size: 20px;
  font-weight: 400;
  margin: 0 0 8px;
  color: var(--procounsel-primary, #19223a);
}

.error-404__card-text {
  font-size: 15px;
  line-height: 1.65;
  margin: 0;
  color: var(--procounsel-text, #838790);
}

.error-404__links-box {
  padding: 32px 28px;
  background: var(--procounsel-gray2, #ededed);
  border-radius: 8px;
  height: 100%;
}

.error-404__links-box h3 {
  font-family: var(--procounsel-heading-font, "Marcellus", serif);
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 18px;
  color: var(--procounsel-primary, #19223a);
}

.error-404__links-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.error-404__links-list li {
  margin-bottom: 10px;
  padding-left: 18px;
  position: relative;
}

.error-404__links-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--procounsel-base, #c7954a);
}

.error-404__links-list a {
  color: var(--procounsel-primary, #19223a);
  font-weight: 500;
  text-decoration: none;
}

.error-404__links-list a:hover {
  color: var(--procounsel-base, #c7954a);
}

.error-404__cta-box {
  padding: 32px 28px;
  background: var(--procounsel-primary, #19223a);
  border-radius: 8px;
  height: 100%;
  color: #fff;
}

.error-404__cta-box h3 {
  font-family: var(--procounsel-heading-font, "Marcellus", serif);
  font-size: 24px;
  font-weight: 400;
  color: #fff;
  margin-bottom: 12px;
}

.error-404__cta-box > p {
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.7;
  margin-bottom: 22px;
}

.error-404__cta-meta {
  font-size: 15px;
  line-height: 1.8;
}

.error-404__cta-meta a {
  color: #fff;
  text-decoration: none;
}

.error-404__cta-meta a:hover {
  color: var(--procounsel-base, #c7954a);
}

@media (max-width: 767px) {
  .error-404__nav {
    margin-top: 40px;
  }

  .error-404__nav-title {
    font-size: 26px;
  }
}
