/* ==========================================================================
   NARRATIVE GALLERY — "روایت‌هایی از اصالت". Four curated editorial
   objects, each with its OWN architectural silhouette (arch / rectangle
   with side panel / oval frame / gallery matting) — deliberately NOT four
   copies of one card component, so this reads as visually distinct from
   "مجموعه‌های منتخب" above it. They share one design system throughout:
   typography, spacing, shadow depth, arrow style, border-radius language
   and animation timing (550-700ms, the site's --ease).
   ========================================================================== */
.narrative-gallery{
  width: 100%;
  padding: clamp(48px, 5.5vw, 64px) 0 var(--sp-5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.narrative-inner{
  max-width: 1540px;
  width: calc(100% - 80px);
  margin-inline: auto;
}

.narrative-head{
  text-align: center;
  margin: 0 auto clamp(26px, 3vw, 36px);
}
.narrative-head h2{
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 3.4vw, 52px);
  color: var(--forest);
}

/* ---------------------------------------------------------------------- */
/* Desktop: one grid row, 4 cards — intentionally uneven widths           */
/* ---------------------------------------------------------------------- */
.narrative-row{
  display: grid;
  grid-template-columns: 1.04fr 1fr 0.94fr 1.02fr;
  gap: 20px;
  height: clamp(400px, 33vw, 460px);
}

.narrative-card{
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow:
    0 1px 2px rgba(24,20,14,0.04),
    0 10px 22px -10px rgba(24,20,14,0.20),
    0 26px 46px -28px rgba(24,20,14,0.22);
  transition: transform 600ms var(--ease), box-shadow 600ms var(--ease);
}
.narrative-card:hover{
  transform: translateY(-5px);
  box-shadow:
    0 2px 4px rgba(24,20,14,0.05),
    0 16px 30px -12px rgba(24,20,14,0.26),
    0 36px 64px -30px rgba(24,20,14,0.26);
}
.narrative-card:focus-visible{ outline: 2px solid var(--gold); outline-offset: 4px; }

/* ---- Shared typography for all four cards (the silhouettes differ, the
   type does not): one title size, one description size, 2-line clamp so a
   long name never overflows or clips against a card edge. ---- */
.narrative-card h3{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(16px, 1.15vw, 20px);
  line-height: 1.34;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.narrative-desc{
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: .01em;
}

.narrative-arrow{
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(247,242,231,.4);
  color: var(--ivory);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 550ms var(--ease), color 550ms var(--ease), border-color 550ms var(--ease);
}
.narrative-arrow svg{ width: 15px; height: 15px; }
.narrative-card:hover .narrative-arrow{ transform: translate(-5px, -5px); } /* RTL: forward = up-left */

/* ------------------------------------------------------------------------
   CARD 1 — GABBEH: arched-doorway silhouette, solid forest content zone,
   image fills the upper dome. Hover nuance: a slow vertical image drift.
   ------------------------------------------------------------------------ */
.narrative-card--gabbeh{
  display: flex;
  flex-direction: column;
  border-radius: 46% 46% 18px 18px / 30% 30% 6% 6%;
}
.gabbeh-image{ position: relative; flex: 1 1 62%; overflow: hidden; }
.gabbeh-image img{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.03);
  filter: saturate(.95);
  transition: transform 700ms var(--ease), filter 700ms var(--ease);
}
.narrative-card--gabbeh:hover .gabbeh-image img{
  transform: translateY(-5px) scale(1.035);
  filter: saturate(1);
}
.gabbeh-panel{
  position: relative;
  flex: 0 0 auto;
  background: var(--forest);
  color: var(--ivory);
  padding: var(--sp-3) var(--sp-4) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gabbeh-panel::before{
  content: "";
  position: absolute;
  inset-inline: var(--sp-4);
  top: 0;
  height: 1px;
  background: rgba(216,194,149,.32);
  transition: background 600ms var(--ease);
}
.narrative-card--gabbeh:hover .gabbeh-panel::before{ background: rgba(216,194,149,.6); }
.gabbeh-panel h3{
  color: var(--ivory);
  transition: transform 550ms var(--ease);
}
.narrative-card--gabbeh:hover .gabbeh-panel h3{ transform: translateY(-3px); }
.gabbeh-panel .narrative-desc{ color: rgba(247,242,231,.92); }
.gabbeh-panel .narrative-arrow{ margin-top: var(--sp-1); align-self: flex-start; }

/* ------------------------------------------------------------------------
   CARD 2 — KILIM: rectangular architectural frame + narrow forest side
   panel. Hover nuance: the side panel shifts a few px, like a page turn.
   ------------------------------------------------------------------------ */
.narrative-card--kilim{
  display: flex;
  flex-direction: row;
  border-radius: 14px;
}
.kilim-image{ position: relative; flex: 1 1 auto; overflow: hidden; }
.kilim-image img{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  filter: saturate(.95);
  transition: transform 700ms var(--ease), filter 700ms var(--ease);
}
.narrative-card--kilim:hover .kilim-image img{ transform: scale(1.035); filter: saturate(1); }
.kilim-overlay{
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(18,14,10,.86) 0%, rgba(18,14,10,.6) 22%, rgba(18,14,10,.22) 44%, transparent 66%);
}
.kilim-content{
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: var(--sp-3);
  color: #f7f2e7;
  text-shadow: 0 1px 10px rgba(0,0,0,.5);
  transition: transform 550ms var(--ease);
}
.narrative-card--kilim:hover .kilim-content{ transform: translateY(-3px); }
.kilim-content h3{ color: #fff; }
.kilim-content .narrative-desc{ color: rgba(247,242,231,.9); margin-top: 4px; }

.kilim-panel{
  flex: 0 0 21%;
  background: var(--forest);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  transition: transform 600ms var(--ease);
}
.narrative-card--kilim:hover .kilim-panel{ transform: translateX(-4px); }
.kilim-line{
  width: 1px;
  flex: 1 1 auto;
  min-height: 40px;
  background: rgba(216,194,149,.4);
  transition: background 600ms var(--ease);
}
.narrative-card--kilim:hover .kilim-line{ background: rgba(216,194,149,.75); }
.kilim-panel .narrative-arrow{ margin-bottom: var(--sp-1); }

/* ------------------------------------------------------------------------
   CARD 3 — CLASSIC CARPET: soft cream card, image inside an oval editorial
   frame. Lighter and more refined. Hover nuance: the oval frame scales.
   ------------------------------------------------------------------------ */
.narrative-card--classic{
  background: var(--sand);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-3);
  text-align: center;
}
.classic-frame{
  position: relative;
  width: 68%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(200,168,107,.4);
  transition: transform 650ms var(--ease), border-color 650ms var(--ease);
}
.narrative-card--classic:hover .classic-frame{ transform: scale(1.045); border-color: rgba(200,168,107,.7); }
.classic-frame img{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  filter: saturate(.95);
  transition: transform 700ms var(--ease), filter 700ms var(--ease);
}
.narrative-card--classic:hover .classic-frame img{ filter: saturate(1); }
.classic-text h3{
  color: var(--forest);
  transition: transform 550ms var(--ease);
}
.narrative-card--classic:hover .classic-text h3{ transform: translateY(-3px); }
.classic-text .narrative-desc{ color: var(--bronze); margin-top: 6px; }
.narrative-card--classic .narrative-arrow{ color: var(--forest); border-color: rgba(24,60,54,.3); }
.narrative-card--classic:hover .narrative-arrow{ color: var(--gold); border-color: rgba(200,168,107,.6); }

/* ------------------------------------------------------------------------
   CARD 4 — MODERN CARPET: deep-forest gallery matting, bold rectangular
   frame. Hover nuance: the champagne inner border brightens subtly.
   ------------------------------------------------------------------------ */
.narrative-card--modern{
  background: var(--forest);
  border-radius: 22px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.modern-frame{
  position: relative;
  flex: 1 1 auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(216,194,149,.32);
  transition: border-color 600ms var(--ease);
}
.narrative-card--modern:hover .modern-frame{ border-color: rgba(216,194,149,.65); }
.modern-frame img{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  filter: saturate(.95);
  transition: transform 700ms var(--ease), filter 700ms var(--ease);
}
.narrative-card--modern:hover .modern-frame img{ transform: scale(1.035); filter: saturate(1); }
.modern-caption{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
}
.modern-text{ min-width: 0; }
.modern-text h3{
  color: var(--ivory);
  transition: transform 550ms var(--ease);
}
.narrative-card--modern:hover .modern-text h3{ transform: translateY(-3px); }
.modern-text .narrative-desc{ color: rgba(247,242,231,.9); margin-top: 4px; }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce){
  .narrative-card, .narrative-card *{
    transition-duration: .01ms !important;
  }
  .narrative-card:hover,
  .narrative-card:hover *{ transform: none !important; }
}

/* ---------------------------------------------------------------------- */
/* Tablet: 2 full cards per row, each keeps its own silhouette            */
/* ---------------------------------------------------------------------- */
@media (max-width: 1023px){
  .narrative-row{
    display: flex;
    flex-wrap: wrap;
    height: auto;
    gap: var(--sp-3);
  }
  .narrative-row > .narrative-card{
    flex: 0 0 auto;
    width: calc(50% - var(--sp-3) / 2);
    aspect-ratio: 3 / 4;
  }
}

/* ---------------------------------------------------------------------- */
/* Mobile: 1 full card per view, horizontal swipe, no pointer effects     */
/* ---------------------------------------------------------------------- */
@media (max-width: 640px){
  .narrative-inner{ width: calc(100% - 32px); }
  .narrative-row{
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: var(--sp-1);
    scrollbar-width: none;
  }
  .narrative-row::-webkit-scrollbar{ display: none; }
  .narrative-row > .narrative-card{
    width: 100%;
    aspect-ratio: 3 / 4;
    scroll-snap-align: start;
  }
}
