/* =========================================================
   AMAX Page-Specific Layouts
   Hero, services, projects, about, contact, portfolio pages
   ========================================================= */

/* ---------------------------------------------------------
   Hero (split-screen)
   --------------------------------------------------------- */
.hero {
  min-height: 100vh;
  padding-top: var(--nav-height);
  display: grid;
  grid-template-columns: 50% 50%;
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--grid) * 8) calc(var(--grid) * 8) calc(var(--grid) * 8) calc(var(--grid) * 4);
  background: var(--blue);
  color: var(--white);
  position: relative;
}

.hero-content::after {
  content: '';
  position: absolute;
  top: calc(var(--grid) * 8);
  right: calc(var(--grid) * 6);
  width: 80px;
  height: 80px;
  background: var(--orange);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  opacity: 0.9;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--grid) * 2);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: calc(var(--grid) * 5);
}

.hero-label::before {
  content: '';
  width: 32px;
  height: 3px;
  background: var(--orange);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 6vw, 6rem);
  line-height: 0.95;
  font-weight: 700;
  margin-bottom: calc(var(--grid) * 5);
  letter-spacing: -2px;
}

.hero-desc {
  font-size: 1.0625rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 480px;
  margin-bottom: calc(var(--grid) * 6);
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: calc(var(--grid) * 3);
  flex-wrap: wrap;
}

.hero-image {
  position: relative;
  height: 100%;
  min-height: 600px;
  overflow: hidden;
}

.hero-image img {
  width: 100%;
  height: 100%;
  min-height: 600px;
  object-fit: cover;
}

.hero-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 80px;
  height: 100%;
  background: linear-gradient(to right, var(--blue), transparent);
  z-index: 2;
}

.hero-badge {
  position: absolute;
  bottom: calc(var(--grid) * 5);
  right: calc(var(--grid) * 5);
  background: var(--orange);
  color: var(--white);
  padding: calc(var(--grid) * 3);
  z-index: 3;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}

.hero-badge h3 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: calc(var(--grid) / 2);
}

.hero-badge p {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hero-slideshow {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 0;
  transition: opacity var(--crossfade-fade) ease-in-out;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform calc(var(--crossfade-duration) * 2) ease-out;
}

.hero-slide.active {
  opacity: 1;
  z-index: 1;
}

.hero-slide.active img {
  transform: scale(1.05);
}

/* ---------------------------------------------------------
   Services
   --------------------------------------------------------- */
.services {
  background: var(--off-white);
}

.services-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--grid) * 8);
  align-items: end;
  margin-bottom: calc(var(--grid) * 8);
}

.services-header p {
  color: var(--gray);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: calc(var(--grid) * 4);
}

/* ---------------------------------------------------------
   Projects
   --------------------------------------------------------- */
.projects {
  background: var(--white);
}

.projects-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto calc(var(--grid) * 8);
}

.projects-header p {
  color: var(--gray);
  font-size: 1.0625rem;
  line-height: 1.7;
  margin-top: calc(var(--grid) * 4);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: calc(var(--grid) * 3);
}

.project-card img {
  min-height: 360px;
}

/* ---------------------------------------------------------
   About
   --------------------------------------------------------- */
.about {
  background: var(--blue);
  color: var(--white);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--grid) * 8);
  align-items: center;
}

.about-content .section-label {
  color: var(--orange);
}

.about-content .section-title {
  color: var(--white);
}

.about-content p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: calc(var(--grid) * 3);
}

.about-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: calc(var(--grid) * 3);
  margin-top: calc(var(--grid) * 5);
}

.about-image {
  position: relative;
}

.about-image img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  border: 4px solid var(--white);
}

.about-image::before {
  content: '';
  position: absolute;
  top: 24px;
  left: -24px;
  width: 100%;
  height: 100%;
  border: 4px solid var(--orange);
  z-index: -1;
}

/* ---------------------------------------------------------
   Contact CTA
   --------------------------------------------------------- */
.contact {
  background: var(--off-white);
  text-align: center;
  position: relative;
}

.contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(45deg, var(--orange), var(--orange) 20px, var(--blue) 20px, var(--blue) 40px);
}

.contact-inner {
  max-width: 840px;
  margin: 0 auto;
  padding-top: calc(var(--grid) * 2);
}

.contact-inner > p {
  color: var(--gray);
  font-size: 1.0625rem;
  line-height: 1.7;
  margin: calc(var(--grid) * 5) auto calc(var(--grid) * 6);
  max-width: 520px;
}

/* ---------------------------------------------------------
   Portfolio pages
   --------------------------------------------------------- */
.page-header {
  padding-top: calc(var(--nav-height) + var(--grid) * 8);
  padding-bottom: calc(var(--grid) * 8);
  background: var(--blue);
  color: var(--white);
  text-align: center;
}

.page-header .section-label {
  justify-content: center;
}

.page-header .section-label::before,
.page-header .section-label::after {
  content: '';
  width: 32px;
  height: 3px;
  background: var(--orange);
}

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: calc(var(--grid) * 3);
}

.page-header p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.0625rem;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}

.page-header .filter-bar {
  margin-top: calc(var(--grid) * 6);
}

.page-header .filter-btn {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.4);
}

.page-header .filter-btn:hover,
.page-header .filter-btn.active {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}

.gallery-section {
  padding: calc(var(--grid) * 8) 0 calc(var(--grid) * 12);
  background: var(--off-white);
}

/* ---------------------------------------------------------
   Home Renovation section carousels
   --------------------------------------------------------- */
.reno-nav {
  position: sticky;
  top: var(--nav-height);
  background: var(--white);
  border-bottom: 2px solid var(--blue);
  z-index: 100;
  padding: calc(var(--grid) * 2) 0;
}

.reno-nav-inner {
  display: flex;
  gap: calc(var(--grid) * 2);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.reno-nav-inner::-webkit-scrollbar {
  display: none;
}

.reno-nav a {
  flex-shrink: 0;
  padding: calc(var(--grid)) calc(var(--grid) * 3);
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--blue);
  border: 2px solid var(--blue);
  transition: var(--transition);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.reno-nav a:hover,
.reno-nav a.active {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}

.reno-section {
  padding: calc(var(--grid) * 10) 0;
  border-bottom: 1px solid var(--gray-light);
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  scroll-margin-top: calc(var(--grid) * 14);
}

.reno-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reno-section-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: calc(var(--grid) * 4);
  align-items: start;
  margin-bottom: calc(var(--grid) * 6);
}

.reno-number {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--orange);
  line-height: 1;
}

.reno-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  color: var(--blue);
  margin-bottom: calc(var(--grid) * 2);
}

.reno-desc {
  color: var(--gray);
  font-size: 1.0625rem;
  line-height: 1.7;
  max-width: 640px;
}

.reno-carousel {
  padding: 0 calc(var(--grid) * 4);
}

/* ---------------------------------------------------------
   Factory before/after slideshow
   --------------------------------------------------------- */
.factory-slideshow-section {
  background: var(--off-white);
  text-align: center;
}

.factory-slideshow-section .section-label.centered {
  justify-content: center;
}

.factory-slideshow-section .section-title {
  margin-bottom: calc(var(--grid) * 6);
}

.factory-slideshow {
  position: relative;
  width: 100%;
  max-width: 900px;
  height: 480px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
}

.factory-slideshow-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 0;
  transition: opacity 0.8s ease-in-out;
}

.factory-slideshow-slide.active {
  opacity: 1;
  z-index: 1;
}

.factory-slideshow-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.factory-slideshow-label {
  position: absolute;
  bottom: calc(var(--grid) * 4);
  left: calc(var(--grid) * 4);
  background: var(--orange);
  color: var(--white);
  padding: calc(var(--grid) * 2) calc(var(--grid) * 4);
  z-index: 2;
  text-align: left;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.factory-slideshow-label span {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.9;
  margin-bottom: calc(var(--grid) / 2);
}

.factory-slideshow-label h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Synchronized before/after panels. The JS advances both columns together. */
.factory-before-after {
  display: grid;
  gap: calc(var(--grid) * 3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 auto;
  max-width: 1200px;
}

.factory-panel {
  aspect-ratio: 4 / 3;
  background: var(--gray-light);
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}

.factory-fade-slides,
.factory-fade-slide {
  inset: 0;
  position: absolute;
}

.factory-fade-slide {
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.factory-fade-slide.active {
  opacity: 1;
}

.factory-fade-slide img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.factory-panel-label {
  background: var(--orange);
  bottom: calc(var(--grid) * 3);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  color: var(--white);
  display: grid;
  gap: 2px;
  left: calc(var(--grid) * 3);
  padding: calc(var(--grid) * 1.5) calc(var(--grid) * 3);
  position: absolute;
  text-align: left;
  z-index: 2;
}

.factory-panel-label span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.factory-panel-label strong {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2vw, 1.45rem);
}

@media (max-width: 1024px) {
  .factory-slideshow {
    height: 360px;
  }
}

@media (max-width: 640px) {
  .factory-slideshow {
    height: 240px;
  }

  .factory-before-after {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-content {
    padding: calc(var(--grid) * 8) calc(var(--grid) * 4);
  }

  .hero-content::after {
    top: calc(var(--grid) * 4);
    right: calc(var(--grid) * 4);
    width: 60px;
    height: 60px;
  }

  .hero-image {
    min-height: 450px;
  }

  .hero-image img {
    min-height: 450px;
  }

  .hero-image::before {
    width: 100%;
    height: 80px;
    background: linear-gradient(to bottom, var(--blue), transparent);
    top: 0;
  }

  .services-header {
    grid-template-columns: 1fr;
    gap: calc(var(--grid) * 4);
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-card img {
    min-height: 320px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: calc(var(--grid) * 8);
  }

  .about-image img {
    height: 420px;
  }

  .contact-info {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .reno-section-header {
    grid-template-columns: 1fr;
    gap: calc(var(--grid) * 2);
  }

  .reno-number {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .nav-links,
  .nav-right .nav-cta {
    display: none;
  }

  .nav-right {
    gap: calc(var(--grid) * 2);
  }

  .mobile-menu-btn {
    display: flex;
  }

  .hero-title {
    font-size: clamp(1.875rem, 8vw, 2.25rem);
    letter-spacing: -0.5px;
  }

  .hero {
    padding-top: var(--nav-height-mobile);
  }

  .hero-content {
    padding: calc(var(--grid) * 5) calc(var(--grid) * 2) calc(var(--grid) * 6);
  }

  .hero-desc {
    font-size: 1rem;
    margin-bottom: calc(var(--grid) * 4);
  }

  .hero-image,
  .hero-image img {
    height: clamp(240px, 70vw, 320px);
    min-height: 0;
  }

  .hero-badge {
    right: calc(var(--grid) * 2);
    bottom: calc(var(--grid) * 2);
    padding: calc(var(--grid) * 2);
  }

  .hero-badge h3 {
    font-size: 1.5rem;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .hero-buttons .btn-primary,
  .hero-buttons .btn-outline {
    width: 100%;
    text-align: center;
  }

  section {
    padding: calc(var(--grid) * 7) 0;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-card img {
    height: 220px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-card img {
    min-height: 220px;
  }

  .about-features {
    grid-template-columns: 1fr;
  }

  .about-image img {
    height: 280px;
  }

  .about-image::before {
    display: none;
  }

  .contact-info {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: calc(var(--grid) * 5);
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
    align-items: center;
  }

  .filter-btn {
    width: 100%;
    max-width: 260px;
  }

  .page-header {
    padding-top: calc(var(--nav-height-mobile) + var(--grid) * 5);
    padding-bottom: calc(var(--grid) * 5);
  }

  .page-title {
    font-size: clamp(2rem, 8vw, 2.5rem);
  }

  .page-header p {
    font-size: 1rem;
  }

  .gallery-section {
    padding: calc(var(--grid) * 6) 0 calc(var(--grid) * 8);
  }

  .reno-nav {
    top: var(--nav-height-mobile);
  }

  .reno-section {
    padding: calc(var(--grid) * 6) 0;
    scroll-margin-top: calc(var(--nav-height-mobile) + var(--grid) * 2);
  }

  .reno-carousel {
    padding: 0;
  }

  .reno-section-header {
    gap: calc(var(--grid) * 2);
    margin-bottom: calc(var(--grid) * 4);
  }

  .reno-number {
    font-size: 2rem;
  }

  .reno-title {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }

  .reno-desc {
    font-size: 1rem;
  }

  .reno-nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .factory-slideshow-section .section-title {
    margin-bottom: calc(var(--grid) * 4);
  }

  .factory-slideshow-label {
    left: calc(var(--grid) * 2);
    bottom: calc(var(--grid) * 2);
    padding: calc(var(--grid) * 1.5) calc(var(--grid) * 2);
  }

  .factory-slideshow-label h3 {
    font-size: clamp(1.25rem, 6vw, 1.75rem);
  }

  .factory-panel-label {
    left: calc(var(--grid) * 2);
    bottom: calc(var(--grid) * 2);
    padding: calc(var(--grid) * 1.5) calc(var(--grid) * 2);
  }

  .factory-panel-label strong {
    font-size: clamp(0.95rem, 4.5vw, 1.2rem);
  }
}
