/* Our Work / Gallery Component Styles - Finewoods Luxury Furniture */

/* ─── Variables ───────────────────────────────────────── */
:root {
  --gallery-bg:       #FAF8F5;
  --gallery-card-bg:  #FFFFFF;
  --gallery-text:     #2B2926;
  --gallery-muted:    #66625D;
  --gold:             #C9A96E;
  --gold-light:       #D8BC86;
  --gold-dark:        #A38148;
  --gallery-border:   rgba(201, 169, 110, 0.22);
}

/* ─── Gallery Section Base ────────────────────────────── */
.gallery-section {
  width: 100%;
  background-color: var(--gallery-bg);
  color: var(--gallery-text);
  padding: 4.5rem 1rem;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.gallery-container {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* ─── Header ──────────────────────────────────────────── */
.gallery-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3rem auto;
}

.gallery-eyebrow {
  display: inline-block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.gallery-heading {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 3.1rem;
  font-weight: 500;
  line-height: 1.18;
  color: var(--gallery-text);
  margin-bottom: 1.1rem;
  letter-spacing: -0.01em;
}

.gallery-description {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--gallery-muted);
}

/* ─── 3D Curved Orbit Stage ───────────────────────────── */
.work-orbit-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.work-orbit-stage {
  position: relative;
  width: 100%;
  max-width: 1380px;
  height: 440px;
  perspective: 1150px;
  transform-style: preserve-3d;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* ─── Work Card Base ──────────────────────────────────── */
.work-card {
  position: absolute;
  width: 440px;
  height: 350px;
  border-radius: 6px;
  overflow: hidden;
  background-color: #1A1918;
  box-shadow: 0 14px 38px rgba(27, 24, 21, 0.12);
  cursor: pointer;
  user-select: none;
  transform-origin: center center;
}

.work-card-img-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.work-card-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: opacity 750ms cubic-bezier(0.25, 1, 0.5, 1),
              transform 750ms cubic-bezier(0.25, 1, 0.5, 1);
}

.work-card-img.img-front {
  z-index: 2;
  opacity: 1;
}

.work-card-img.img-back {
  z-index: 1;
  opacity: 1;
}

.work-card-img.fade-out {
  opacity: 0;
  transform: scale(1.02);
}

.work-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(20, 18, 16, 0.05) 0%, rgba(20, 18, 16, 0.45) 100%);
  opacity: 0;
  transition: opacity 750ms ease;
  pointer-events: none;
  z-index: 3;
}

/* ─── 3D Orbital Positional States (No Overlap, Outer Card Peeking) ─── */

/* CENTER IMAGE (Largest, Main Focus, Elevated, Noticeably Taller and Wider) */
.work-card.is-center {
  transform: translate3d(0, 0, 30px) rotateY(0deg) rotateZ(0deg) scale(1.08);
  opacity: 1;
  z-index: 10;
  filter: brightness(1);
  box-shadow: 0 22px 55px rgba(35, 28, 22, 0.22);
}

.work-card.is-center .work-card-overlay {
  opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
  .work-card.is-center:hover .work-card-img {
    transform: scale(1.035);
  }
}

/* LEFT IMAGE (Clearly visible beside center, shorter & smaller, tilted -14deg) */
.work-card.is-left {
  transform: translate3d(-435px, 0, 0px) rotateY(-14deg) rotateZ(1deg) scale(0.78);
  opacity: 0.88;
  z-index: 5;
  filter: brightness(0.85);
}

.work-card.is-left .work-card-overlay {
  opacity: 0.3;
}

@media (hover: hover) and (pointer: fine) {
  .work-card.is-left:hover {
    transform: translate3d(-430px, 0, 10px) rotateY(-10deg) rotateZ(0.5deg) scale(0.81);
    opacity: 0.96;
    filter: brightness(0.93);
  }
}

/* RIGHT IMAGE (Clearly visible beside center, shorter & smaller, tilted +14deg) */
.work-card.is-right {
  transform: translate3d(435px, 0, 0px) rotateY(14deg) rotateZ(-1deg) scale(0.78);
  opacity: 0.88;
  z-index: 5;
  filter: brightness(0.85);
}

.work-card.is-right .work-card-overlay {
  opacity: 0.3;
}

@media (hover: hover) and (pointer: fine) {
  .work-card.is-right:hover {
    transform: translate3d(430px, 0, 10px) rotateY(10deg) rotateZ(-0.5deg) scale(0.81);
    opacity: 0.96;
    filter: brightness(0.93);
  }
}

/* OUTER LEFT PREVIEW IMAGE (Small peeking edge outside current left image) */
.work-card.is-outer-left {
  transform: translate3d(-740px, 0, -45px) rotateY(-22deg) rotateZ(1.5deg) scale(0.62);
  opacity: 0.45;
  z-index: 2;
  filter: brightness(0.7);
}

.work-card.is-outer-left .work-card-overlay {
  opacity: 0.55;
}

@media (hover: hover) and (pointer: fine) {
  .work-card.is-outer-left:hover {
    transform: translate3d(-730px, 0, -30px) rotateY(-18deg) rotateZ(1deg) scale(0.65);
    opacity: 0.7;
    filter: brightness(0.85);
  }
}

/* OUTER RIGHT PREVIEW IMAGE (Small peeking edge outside current right image) */
.work-card.is-outer-right {
  transform: translate3d(740px, 0, -45px) rotateY(22deg) rotateZ(-1.5deg) scale(0.62);
  opacity: 0.45;
  z-index: 2;
  filter: brightness(0.7);
}

.work-card.is-outer-right .work-card-overlay {
  opacity: 0.55;
}

@media (hover: hover) and (pointer: fine) {
  .work-card.is-outer-right:hover {
    transform: translate3d(730px, 0, -30px) rotateY(18deg) rotateZ(-1deg) scale(0.65);
    opacity: 0.7;
    filter: brightness(0.85);
  }
}

/* HIDDEN CARDS */
.work-card.is-hidden-left {
  transform: translate3d(-960px, 0, -120px) rotateY(-30deg) scale(0.5);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

.work-card.is-hidden-right {
  transform: translate3d(960px, 0, -120px) rotateY(30deg) scale(0.5);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

/* ─── Active Project Info Box — Hidden (titles removed per design) ─── */
.work-info-box {
  display: none;
}

.work-info-box.fade-out {
  opacity: 0;
  transform: translateY(6px);
}

.work-info-category {
  display: none;
}

.work-info-title {
  display: none;
}

.work-info-desc {
  display: none;
}

/* ─── Navigation Controls ─────────────────────────────── */
.work-nav-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

/* ─── Work CTA Button ──────────────────────────────────── */
.work-cta-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  width: 100%;
}

.work-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 2.2rem;
  background-color: var(--gallery-text);
  color: #FFFFFF;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid var(--gallery-text);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease, transform 0.35s ease;
}

.work-cta-btn:hover {
  background-color: var(--gold);
  border-color: var(--gold);
  color: #FFFFFF;
  transform: translateY(-2px);
}

.work-cta-arrow {
  transition: transform 0.3s ease;
}

.work-cta-btn:hover .work-cta-arrow {
  transform: translateX(4px);
}

.gallery-section.is-ar .work-cta-btn:hover .work-cta-arrow,
[dir="rtl"] .gallery-section .work-cta-btn:hover .work-cta-arrow {
  transform: translateX(-4px);
}

.work-nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--gallery-border);
  background-color: #FFFFFF;
  color: var(--gallery-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.work-nav-btn:hover {
  background-color: var(--gold);
  border-color: var(--gold);
  color: #FFFFFF;
  transform: scale(1.05);
}

.work-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.work-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: rgba(201, 169, 110, 0.3);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-dot:hover {
  background-color: rgba(201, 169, 110, 0.6);
}

.work-dot.active {
  width: 26px;
  border-radius: 13px;
  background-color: var(--gold);
}

/* ─── RTL / Arabic Styling ───────────────────────────── */
.gallery-section.is-ar,
[dir="rtl"] .gallery-section {
  direction: rtl;
}

.gallery-section.is-ar .gallery-eyebrow,
[dir="rtl"] .gallery-section .gallery-eyebrow,
.gallery-section.is-ar .work-info-category,
[dir="rtl"] .gallery-section .work-info-category {
  letter-spacing: 0.08em;
}

.gallery-section.is-ar .gallery-heading,
[dir="rtl"] .gallery-section .gallery-heading,
.gallery-section.is-ar .work-info-title,
[dir="rtl"] .gallery-section .work-info-title {
  font-family: 'Cormorant Garamond', 'Plus Jakarta Sans', serif;
}

/* ─── Reduced Motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .work-card,
  .work-info-box,
  .work-dot {
    transition: none !important;
  }
}

/* ─── Responsive Breakpoints ─────────────────────────── */

@media (max-width: 1200px) {
  .work-card {
    width: 390px;
    height: 310px;
  }
  .work-orbit-stage {
    max-width: 1180px;
    height: 400px;
  }
  .work-card.is-center {
    transform: translate3d(0, 0, 30px) rotateY(0deg) scale(1.08);
  }
  .work-card.is-left {
    transform: translate3d(-385px, 0, 0px) rotateY(-13deg) rotateZ(1deg) scale(0.78);
  }
  .work-card.is-right {
    transform: translate3d(385px, 0, 0px) rotateY(13deg) rotateZ(-1deg) scale(0.78);
  }
  .work-card.is-outer-left {
    transform: translate3d(-650px, 0, -40px) rotateY(-20deg) scale(0.62);
    opacity: 0.4;
  }
  .work-card.is-outer-right {
    transform: translate3d(650px, 0, -40px) rotateY(20deg) scale(0.62);
    opacity: 0.4;
  }
}

@media (max-width: 1024px) {
  .gallery-section {
    padding: 5rem 0.75rem;
  }
  .gallery-heading {
    font-size: 2.6rem;
  }
  .work-card {
    width: 330px;
    height: 270px;
  }
  .work-orbit-stage {
    max-width: 1000px;
    height: 360px;
  }
  .work-card.is-center {
    transform: translate3d(0, 0, 30px) rotateY(0deg) scale(1.08);
  }
  .work-card.is-left {
    transform: translate3d(-325px, 0, 0px) rotateY(-12deg) rotateZ(1deg) scale(0.78);
  }
  .work-card.is-right {
    transform: translate3d(325px, 0, 0px) rotateY(12deg) rotateZ(-1deg) scale(0.78);
  }
  .work-card.is-outer-left {
    transform: translate3d(-540px, 0, -35px) rotateY(-18deg) scale(0.62);
    opacity: 0.38;
  }
  .work-card.is-outer-right {
    transform: translate3d(540px, 0, -35px) rotateY(18deg) scale(0.62);
    opacity: 0.38;
  }
  .work-info-title {
    font-size: 1.85rem;
  }
}

/* Mobile & Small Screens (<768px) */
@media (max-width: 768px) {
  .gallery-section {
    padding: 3.8rem 0.5rem;
  }
  .gallery-header {
    margin-bottom: 1.75rem;
  }
  .gallery-heading {
    font-size: 2rem;
  }
  .gallery-description {
    font-size: 0.9rem;
  }

  /* 3D Orbit Stage for Mobile Viewports */
  .work-orbit-stage {
    height: 270px;
    perspective: 700px;
  }

  .work-card {
    width: 240px;
    height: 205px;
    border-radius: 6px;
  }

  .work-card.is-center {
    transform: translate3d(0, 0, 20px) rotateY(0deg) scale(1.06);
  }

  .work-card.is-left {
    transform: translate3d(-215px, 0, 0px) rotateY(-11deg) rotateZ(1deg) scale(0.76);
    opacity: 0.85;
  }

  .work-card.is-right {
    transform: translate3d(215px, 0, 0px) rotateY(11deg) rotateZ(-1deg) scale(0.76);
    opacity: 0.85;
  }

  .work-card.is-outer-left {
    transform: translate3d(-350px, 0, -30px) rotateY(-18deg) scale(0.60);
    opacity: 0.35;
  }

  .work-card.is-outer-right {
    transform: translate3d(350px, 0, -30px) rotateY(18deg) scale(0.60);
    opacity: 0.35;
  }

  .work-info-box {
    margin: 1.1rem auto 0.85rem auto;
  }

  .work-info-title {
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
  }

  .work-info-desc {
    font-size: 0.85rem;
    line-height: 1.48;
  }

  .work-nav-btn {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 390px) {
  .work-orbit-stage {
    height: 230px;
  }
  .work-card {
    width: 170px;
    height: 160px;
  }
  .work-card.is-center {
    transform: translate3d(0, 0, 20px) rotateY(0deg) scale(1.06);
  }
  .work-card.is-left {
    transform: translate3d(-150px, 0, 0px) rotateY(-10deg) scale(0.76);
  }
  .work-card.is-right {
    transform: translate3d(150px, 0, 0px) rotateY(10deg) scale(0.76);
  }
  .work-card.is-outer-left {
    transform: translate3d(-245px, 0, -25px) rotateY(-15deg) scale(0.58);
    opacity: 0.3;
  }
  .work-card.is-outer-right {
    transform: translate3d(245px, 0, -25px) rotateY(15deg) scale(0.58);
    opacity: 0.3;
  }
  .work-info-title {
    font-size: 1.35rem;
  }
  .work-info-desc {
    font-size: 0.78rem;
  }
}
