/* ==========================================================================
   Swamini Photography - Upgraded "OUR WORK" Portfolio Section CSS
   (Exact Pixel-Fidelity Image-to-Code Reference Alignment)
   ========================================================================== */

/* Section Outer Container */
#portfolio.our-work-section-upgrade {
  background-color: #FAF5EE;
  background-image: radial-gradient(circle at 90% 10%, rgba(215, 185, 138, 0.12) 0%, transparent 40%),
                    radial-gradient(circle at 10% 90%, rgba(215, 185, 138, 0.08) 0%, transparent 40%);
  padding-top: 100px;
  padding-bottom: 90px;
  position: relative;
  overflow: hidden;
}

/* Decorative Background Florals / Leaf Watermark */
.our-work-bg-leaf-top {
  position: absolute;
  top: 20px;
  right: 40px;
  width: 220px;
  height: 220px;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.our-work-bg-leaf-bottom {
  position: absolute;
  bottom: 30px;
  right: 60px;
  width: 260px;
  height: 180px;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}

/* Section Header */
.work-upgrade-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 36px;
  gap: 24px;
  z-index: 1;
}

.work-header-left {
  max-width: 780px;
}

.work-eyebrow-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #B3844D;
  margin-bottom: 12px;
}

.work-eyebrow-line::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background-color: #B3844D;
}

.work-title-upgrade {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4.4vw, 3.8rem);
  font-weight: 500;
  line-height: 1.12;
  color: #171514;
  margin-bottom: 14px;
}

.work-title-upgrade em {
  font-family: var(--font-serif);
  font-style: italic;
  color: #B3844D;
  font-weight: 400;
}

.work-subtitle-upgrade {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.6;
  color: #6E6259;
  max-width: 680px;
}

.work-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.work-script-top {
  font-family: var(--font-script);
  font-size: 2.2rem;
  color: #B3844D;
  line-height: 1.05;
  text-align: right;
  transform: rotate(-3deg);
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .work-upgrade-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
  }
  .work-header-right {
    align-items: flex-start;
    width: 100%;
  }
  .work-script-top {
    text-align: left;
    transform: rotate(-2deg);
    font-size: clamp(1.4rem, 5vw, 1.85rem);
    white-space: normal;
  }
}

/* ==========================================================================
   Filter Bar & View All Button Row
   ========================================================================== */
.work-controls-bar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 34px;
  gap: 16px;
  flex-wrap: wrap;
  z-index: 1;
}

.work-filter-pills-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.work-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background-color: transparent;
  border: 1px solid rgba(179, 132, 77, 0.25);
  color: #5A4E45;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.work-filter-pill svg {
  width: 15px;
  height: 15px;
  color: #B3844D;
  transition: color 0.25s ease;
}

.work-filter-pill:hover {
  border-color: #B3844D;
  color: #171514;
  background-color: rgba(215, 185, 138, 0.12);
}

.work-filter-pill.active {
  background-color: #9E6B3F;
  border-color: #9E6B3F;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(158, 107, 63, 0.25);
}

.work-filter-pill.active svg {
  color: #FFFFFF;
}

.btn-view-gallery-dark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  background-color: #171514;
  color: #FFFDFC;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: all 0.25s ease;
  border: 1px solid #171514;
}

.btn-view-gallery-dark:hover {
  background-color: #332A24;
  border-color: #332A24;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(23, 21, 20, 0.2);
}

/* ==========================================================================
   Bento Grid Layout (Exact 3-Column Visual Match)
   ========================================================================== */
.work-bento-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.45fr 1fr 1fr;
  grid-template-rows: 240px 240px 250px;
  gap: 20px;
  z-index: 1;
}

/* Individual Bento Cards */
.work-bento-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background-color: #0C0A09;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
  box-shadow: 0 8px 24px rgba(23, 21, 20, 0.08);
}

.work-bento-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(23, 21, 20, 0.16);
}

/* Card Specific Positions on Desktop */
.work-bento-card.card-wedding {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
}

.work-bento-card.card-prewedding {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
}

.work-bento-card.card-baby {
  grid-column: 3 / 4;
  grid-row: 1 / 2;
}

.work-bento-card.card-couple {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
}

.work-bento-card.card-events {
  grid-column: 3 / 4;
  grid-row: 2 / 3;
}

.work-bento-card.card-maternity {
  grid-column: 1 / 2;
  grid-row: 3 / 4;
}

.work-bento-card.card-corporate {
  grid-column: 2 / 3;
  grid-row: 3 / 4;
}

.work-bento-card.card-albums {
  grid-column: 3 / 4;
  grid-row: 3 / 4;
}

/* Card Image & Overlay */
.work-bento-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.work-bento-card:hover .work-bento-img {
  transform: scale(1.06);
}

.card-prewedding .work-bento-img {
  object-position: center 30%;
}

.work-bento-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 10, 9, 0) 30%, rgba(12, 10, 9, 0.45) 65%, rgba(12, 10, 9, 0.88) 100%);
  pointer-events: none;
}

/* Card Content / Text */
.work-bento-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 2;
  pointer-events: none;
}

.work-bento-text-wrap {
  display: flex;
  flex-direction: column;
}

.work-bento-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 500;
  color: #FFFDFC;
  line-height: 1.15;
  margin-bottom: 4px;
}

.work-bento-card.card-wedding .work-bento-title {
  font-size: 1.7rem;
}

.work-bento-subtitle {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

/* Round Action Arrow Circle */
.work-bento-arrow-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(217, 188, 147, 0.45);
  background: rgba(23, 21, 20, 0.55);
  backdrop-filter: blur(6px);
  color: #D9BC93;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.work-bento-card:hover .work-bento-arrow-btn {
  background-color: #D7B98A;
  border-color: #D7B98A;
  color: #171514;
  transform: scale(1.08);
}

/* Responsive Grid Adjustments */
@media (max-width: 1023px) {
  .work-bento-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    gap: 16px;
  }
  
  .work-bento-card.card-wedding {
    grid-column: 1 / 3;
    grid-row: auto;
    height: 380px;
  }

  .work-bento-card.card-prewedding,
  .work-bento-card.card-baby,
  .work-bento-card.card-couple,
  .work-bento-card.card-events,
  .work-bento-card.card-maternity,
  .work-bento-card.card-corporate,
  .work-bento-card.card-albums {
    grid-column: auto;
    grid-row: auto;
    height: 240px;
  }
}

@media (max-width: 640px) {
  #portfolio.portfolio-section-upgrade {
    padding-top: 60px;
    padding-bottom: 50px;
  }

  .work-title-upgrade {
    font-size: clamp(2rem, 7.5vw, 2.5rem);
    line-height: 1.15;
  }

  .work-filter-pills-wrap {
    gap: 6px;
    width: 100%;
  }

  .work-filter-pill {
    padding: 6px 12px;
    font-size: 0.74rem;
    gap: 5px;
  }

  .btn-view-gallery-dark {
    width: 100%;
    justify-content: center;
  }

  .work-bento-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .work-bento-card.card-wedding {
    grid-column: 1 / 2;
    height: 280px;
  }

  .work-bento-card.card-prewedding,
  .work-bento-card.card-baby,
  .work-bento-card.card-couple,
  .work-bento-card.card-events,
  .work-bento-card.card-maternity,
  .work-bento-card.card-corporate,
  .work-bento-card.card-albums {
    grid-column: 1 / 2;
    height: 210px;
  }
}

/* ==========================================================================
   Filtered View (set by gallery.js when a category other than "All" is picked)
   The bento layout pins every card to a fixed cell, so a lone filtered card
   would sit in its old corner beside empty space. Instead the first match
   (.is-featured) takes the big first-photo slot, sized and styled exactly like
   the wedding photo in "All"; any further matches fill the smaller cells.
   ========================================================================== */
.work-bento-grid.is-filtered {
  grid-template-rows: none;
  grid-auto-rows: 240px;
}

.work-bento-grid.is-filtered .work-bento-card {
  grid-column: auto;
  grid-row: auto;
}

.work-bento-grid.is-filtered .work-bento-card.is-featured {
  grid-column: 1 / 2;
  grid-row: span 2;
}

.work-bento-grid.is-filtered .is-featured .work-bento-title {
  font-size: 1.7rem;
}

@media (max-width: 1023px) {
  .work-bento-grid.is-filtered {
    grid-auto-rows: auto;
  }

  .work-bento-grid.is-filtered .work-bento-card.is-featured {
    grid-column: 1 / 3;
    grid-row: auto;
    height: 380px;
  }
}

@media (max-width: 640px) {
  .work-bento-grid.is-filtered .work-bento-card.is-featured {
    grid-column: 1 / 2;
    height: 280px;
  }
}

.work-bento-card.is-entering {
  animation: work-card-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards; /* backwards: hover zoom still works after */
}

@keyframes work-card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .work-bento-card.is-entering {
    animation: none;
  }
}

/* ==========================================================================
   Bottom Trust & Stats Strip
   ========================================================================== */
.work-bottom-stats-container {
  position: relative;
  margin-top: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  z-index: 1;
}

.work-stats-card-strip {
  background: #FFFFFF;
  border: 1px solid rgba(179, 132, 77, 0.16);
  border-radius: 18px;
  padding: 20px 32px;
  box-shadow: 0 10px 30px rgba(33, 26, 23, 0.04);
  display: flex;
  align-items: center;
  flex-grow: 1;
  max-width: 880px;
}

.work-stat-block {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.work-stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(215, 185, 138, 0.12);
  border: 1px solid rgba(179, 132, 77, 0.2);
  color: #9E6B3F;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.work-stat-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.work-stat-number {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  color: #171514;
  line-height: 1.2;
}

.work-stat-desc {
  font-size: 0.72rem;
  color: #7D7066;
  text-transform: capitalize;
}

.work-stat-divider {
  width: 1px;
  height: 36px;
  background-color: rgba(179, 132, 77, 0.15);
  margin: 0 20px;
}

.work-bottom-script-note {
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: #B3844D;
  line-height: 1.1;
  transform: rotate(-2deg);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .work-stats-card-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    max-width: 100%;
    border-radius: 16px;
  }

  .work-stat-divider {
    display: none;
  }

  .work-bottom-script-note {
    font-size: 1.35rem;
    text-align: center;
    width: 100%;
    white-space: normal;
  }
}
