/* Berlian Automation - Auto Filename Gallery */

.auto-project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.auto-project-card {
  overflow: hidden;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid rgba(14, 32, 55, .10);
  box-shadow: 0 18px 50px rgba(9, 25, 45, .10);
  transition: transform .25s ease, box-shadow .25s ease;
}

.auto-project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 70px rgba(9, 25, 45, .16);
}

.auto-project-cover {
  display: block;
  position: relative;
  height: 230px;
  overflow: hidden;
  background: linear-gradient(135deg, #0b1f33, #123a5b);
}

.auto-project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}

.auto-project-card:hover .auto-project-cover img {
  transform: scale(1.04);
}

.auto-cover-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: .08em;
  color: rgba(255,255,255,.88);
  font-size: 52px;
}

.auto-project-body {
  padding: 22px;
}

.auto-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #f26a21;
}

.auto-project-body h3 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.18;
  color: #0b1f33;
}

.auto-project-body h3 a {
  color: inherit;
  text-decoration: none;
}

.auto-summary {
  margin: 0 0 18px;
  color: rgba(11,31,51,.72);
  font-size: 14px;
  line-height: 1.6;
}

.auto-view-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: #f26a21;
  text-decoration: none;
}

.auto-empty {
  padding: 34px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px dashed rgba(14, 32, 55, .22);
  box-shadow: 0 14px 40px rgba(9, 25, 45, .08);
}

.auto-empty h2,
.auto-empty h3 {
  margin-top: 0;
  color: #0b1f33;
}

.auto-empty code {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 8px;
  background: rgba(11,31,51,.07);
  color: #0b1f33;
}

.auto-detail-hero .breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.auto-detail-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .8fr);
  gap: 34px;
  align-items: center;
}

.auto-detail-intro {
  max-width: 720px;
  color: rgba(255,255,255,.76);
  line-height: 1.7;
}

.auto-detail-cover {
  border-radius: 24px;
  overflow: hidden;
  min-height: 300px;
  box-shadow: 0 22px 70px rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.16);
}

.auto-detail-cover img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
}

.auto-stage-list {
  display: grid;
  gap: 34px;
}

.auto-stage {
  padding: 30px;
  border-radius: 26px;
  background: #ffffff;
  border: 1px solid rgba(14, 32, 55, .10);
  box-shadow: 0 18px 55px rgba(9, 25, 45, .09);
}

.auto-stage-head {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 24px;
}

.auto-stage-number {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #f26a21;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(242,106,33,.28);
}

.auto-stage-head h2 {
  margin: 0 0 8px;
  color: #0b1f33;
  font-size: clamp(24px, 3vw, 34px);
}

.auto-stage-head p:last-child {
  margin: 0;
  color: rgba(11,31,51,.72);
  line-height: 1.7;
}

.auto-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.auto-media-item {
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #f6f8fb;
  border: 1px solid rgba(14, 32, 55, .10);
}

.auto-media-item a {
  display: block;
  height: 230px;
  overflow: hidden;
  background: #0b1f33;
}

.auto-media-item img,
.auto-media-item video {
  display: block;
  width: 100%;
  height: 230px;
  object-fit: cover;
}

.auto-video-item video {
  background: #0b1f33;
}

.auto-media-item figcaption {
  padding: 13px 14px 15px;
  font-size: 14px;
  font-weight: 700;
  color: #0b1f33;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .auto-project-grid,
  .auto-media-grid,
  .auto-detail-hero-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .auto-project-grid,
  .auto-media-grid,
  .auto-detail-hero-grid {
    grid-template-columns: 1fr;
  }

  .auto-project-cover,
  .auto-media-item a,
  .auto-media-item img,
  .auto-media-item video {
    height: 210px;
  }

  .auto-stage {
    padding: 22px;
  }

  .auto-stage-head {
    grid-template-columns: 1fr;
  }
}

.auto-hero-text {
  max-width: 820px;
  color: rgba(255,255,255,.78);
  line-height: 1.7;
  font-size: 18px;
}


/* Latest project marker */
.auto-project-card.is-latest {
  border-color: rgba(242,106,33,.42);
}

.auto-project-cover {
  position: relative;
}

.auto-latest-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9800, #ff6b00);
  color: #07111f;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
}

.home-dynamic-gallery-note {
  text-align: center;
  margin-top: 16px;
  color: rgba(255,255,255,.70);
  font-size: 14px;
}


/* =========================================================
   Project Detail Back Button & Image Lightbox - v58
   ========================================================= */

.auto-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.auto-detail-bottom-action {
  text-align: center;
  margin-top: 36px;
}

.auto-media-item a.auto-lightbox-link {
  position: relative;
  cursor: zoom-in;
}

.auto-media-item a.auto-lightbox-link::after {
  content: "View";
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(2, 8, 17, .74);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(6px);
  transition: .2s ease;
}

.auto-media-item:hover a.auto-lightbox-link::after {
  opacity: 1;
  transform: translateY(0);
}

body.auto-lightbox-open {
  overflow: hidden;
}

.auto-lightbox {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(2, 8, 17, .90);
  backdrop-filter: blur(12px);
}

.auto-lightbox.is-open {
  display: flex;
}

.auto-lightbox-frame {
  width: min(1120px, 94vw);
  max-height: 90vh;
  padding: 14px;
  border-radius: 26px;
  background: #ffffff;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 30px 90px rgba(0,0,0,.46);
}

.auto-lightbox-frame img {
  width: 100%;
  max-height: calc(90vh - 92px);
  object-fit: contain;
  display: block;
  border-radius: 18px;
  background: #07111f;
}

.auto-lightbox-caption {
  margin: 12px 4px 2px;
  color: #0b1f33;
  font-weight: 800;
  line-height: 1.45;
}

.auto-lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 6010;
  min-height: 46px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9800, #ff6b00);
  color: #07111f;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 16px 36px rgba(0,0,0,.28);
}

@media (max-width: 760px) {
  .auto-detail-actions .btn,
  .auto-detail-bottom-action .btn {
    width: 100%;
  }

  .auto-lightbox {
    padding: 14px 14px 86px;
    align-items: center;
    justify-content: center;
  }

  .auto-lightbox-close {
    top: auto;
    bottom: 16px;
    left: 14px;
    right: 14px;
    width: calc(100% - 28px);
    min-height: 50px;
  }

  .auto-lightbox-frame {
    width: 100%;
    max-height: calc(100dvh - 118px);
    padding: 10px;
    border-radius: 20px;
  }

  .auto-lightbox-frame img {
    max-height: calc(100dvh - 196px);
    border-radius: 14px;
  }

  .auto-lightbox-caption {
    font-size: 14px;
  }

  .auto-media-item a.auto-lightbox-link::after {
    opacity: 1;
    transform: none;
  }
}

/* =========================================================
   MOBILE PROJECT DETAIL RENDER FIX
   Mencegah gambar/card hilang lalu baru muncul setelah layar ditekan
   ========================================================= */

@media (max-width: 760px) {
  .auto-detail-page .reveal,
  .auto-project-detail .reveal,
  .auto-stage-card,
  .auto-stage-card *,
  .auto-media-grid,
  .auto-media-grid *,
  .auto-media-card,
  .auto-media-card *,
  .auto-media-link,
  .auto-media-link *,
  .auto-media-item,
  .auto-media-item * {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
    will-change: auto !important;
  }

  .auto-stage-card,
  .auto-media-card,
  .auto-media-item {
    display: block !important;
    position: relative !important;
    z-index: 2 !important;
    overflow: visible !important;
  }

  .auto-media-card img,
  .auto-media-item img,
  .auto-media-link img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateZ(0) !important;
    backface-visibility: hidden !important;
  }

  .auto-media-grid {
    display: grid !important;
    gap: 18px !important;
    overflow: visible !important;
  }
}

/* =========================================================
   PROJECT DETAIL STAGE VISIBILITY FIX - v62
   Tahap dengan banyak gambar (misalnya Pengerjaan) tidak boleh
   memakai reveal opacity parent karena IntersectionObserver bisa
   gagal ketika section terlalu tinggi di mobile.
   ========================================================= */

.auto-stage,
.auto-stage.reveal {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

@media (max-width: 760px) {
  .auto-stage,
  .auto-stage.reveal {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
    will-change: auto !important;
  }

  .auto-stage-head {
    display: grid !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    z-index: 5 !important;
  }
}
