/*
 * Aftab Gallery — Home page (2026). Built by inc/aftab-home.php, motion in assets/js/aftab-home.js.
 * Frames: pieces 5:4, In Focus room 16:9 and detail 5:4, studio 4:5.
 */

.ah {
  font-family: var(--ah-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ah-body);
  padding: var(--ah-section) 0;
}

@media (min-width: 1280px) {
  .ah {
    font-size: 17px;
  }
}

.ah h1,
.ah h2,
.ah h3 {
  font-family: var(--ah-serif);
  font-weight: 400;
  color: var(--ah-head);
  margin: 0;
  letter-spacing: 0.005em;
}

.ah p {
  margin: 0;
  max-width: 62ch;
}

/* House rule: body text justified on both sides, last line left. */
.ah-copy p {
  text-align: justify;
  text-align-last: left;
  -webkit-hyphens: manual;
  hyphens: manual;
}

.ah-copy p + p {
  margin-top: 1em;
}

.ah img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ah-h2 {
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.15;
}

.ah-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: clamp(32px, 4vw, 56px);
}

.ah-links {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 8px;
}

/* ---------- hero caption ---------- */
.ah-hero .swiper-slide {
  position: relative;
}

.ah-hero__cap {
  position: absolute;
  left: 5%;
  bottom: clamp(20px, 4vw, 44px);
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  color: #fff;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1s ease 0.6s, transform 1s ease 0.6s;
}

.ah-hero .swiper-slide-active .ah-hero__cap,
.ah-hero .swiper:not(.swiper-initialized) .swiper-slide:first-child .ah-hero__cap {
  opacity: 1;
  transform: none;
}

.ah-hero__name {
  font-family: var(--ah-serif);
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.2;
}

.ah-hero__link {
  font-family: var(--ah-sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  padding-bottom: 2px;
}

.ah-hero__link:hover,
.ah-hero__link:focus-visible {
  border-bottom-color: #fff;
}

/* ---------- manifesto ---------- */
.ah-intro__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--ah-gap);
}

.ah-intro__title {
  grid-column: 1 / span 6;
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1.08;
}

.ah-intro__copy {
  grid-column: 8 / span 5;
  align-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
}

.ah-intro__copy p {
  font-size: 1.05em;
}

@media (max-width: 899px) {

  .ah-intro__title,
  .ah-intro__copy {
    grid-column: 1 / -1;
  }
}

/* ---------- selected pieces: uneven grid ---------- */
.ah-pieces {
  background: var(--ah-surface);
}

.ah-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: clamp(16px, 2vw, 28px);
  row-gap: clamp(48px, 7vw, 110px);
}

.ah-piece {
  display: block;
  color: inherit;
  text-decoration: none;
}

.ah-piece:nth-child(4n+1) {
  grid-column: 1 / span 5;
}

.ah-piece:nth-child(4n+2) {
  grid-column: 7 / span 4;
  margin-top: clamp(60px, 10vw, 160px);
}

.ah-piece:nth-child(4n+3) {
  grid-column: 2 / span 4;
}

.ah-piece:nth-child(4n+4) {
  grid-column: 8 / span 5;
  margin-top: clamp(24px, 4vw, 64px);
}

.ah-piece__move {
  will-change: transform;
}

.ah-piece__frame {
  position: relative;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  background: #ecebe8;
}

.ah-piece__frame img {
  position: absolute;
  left: 0;
  top: -7%;
  height: 114%;
  will-change: transform;
  transition: scale 1.2s ease;
}

.ah-piece:hover .ah-piece__frame img,
.ah-piece:focus-visible .ah-piece__frame img {
  scale: 1.05;
}

.ah-piece__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--ah-line);
}

.ah-piece__name {
  font-family: var(--ah-serif);
  font-size: 22px;
  line-height: 1.2;
  color: var(--ah-head);
}

.ah-piece__type {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ah-muted);
  white-space: nowrap;
}

@media (max-width: 899px) {
  .ah-grid {
    grid-template-columns: repeat(6, 1fr);
    row-gap: 48px;
  }

  .ah-piece:nth-child(n) {
    margin-top: 0;
  }

  .ah-piece:nth-child(3n+1) {
    grid-column: 1 / -1;
  }

  .ah-piece:nth-child(3n+2) {
    grid-column: 1 / span 3;
  }

  .ah-piece:nth-child(3n+3) {
    grid-column: 4 / span 3;
    margin-top: 60px;
  }

  .ah-piece__name {
    font-size: 18px;
  }

  .ah-piece__meta {
    flex-direction: column;
    gap: 2px;
  }
}

/* Motion (only once the script has started, so the page is complete without it). */
.ah-js .ah-piece {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 1.2s cubic-bezier(0.2, 0.7, 0.2, 1), transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.ah-js .ah-piece.is-in {
  opacity: 1;
  transform: none;
}

.ah-js .ah-piece__frame {
  background: linear-gradient(100deg, #ecebe8 40%, #f5f4f2 50%, #ecebe8 60%) 0 0 / 300% 100%;
  animation: ah-shimmer 1.6s linear infinite;
}

.ah-js .ah-piece__frame.is-loaded {
  animation: none;
  background: #ecebe8;
}

.ah-js .ah-piece__frame img {
  opacity: 0;
  filter: blur(12px);
  transition: opacity 1.1s ease, filter 1.1s ease, scale 1.2s ease;
}

.ah-js .ah-piece__frame.is-loaded img {
  opacity: 1;
  filter: none;
}

@keyframes ah-shimmer {
  to {
    background-position: -150% 0;
  }
}

/* ---------- browse ---------- */
.ah-browse {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: clamp(48px, 6vw, 80px);
  padding-top: 28px;
  border-top: 1px solid var(--ah-line);
  font-size: 14px;
  color: var(--ah-ink);
}

.ah-browse a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.ah-browse a:hover,
.ah-browse a:focus-visible {
  color: var(--ah-bronze);
}

.ah-browse__label {
  color: var(--ah-muted);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  align-self: center;
  margin-right: 8px;
}

/* ---------- in focus ---------- */
.ah-focus__stage {
  position: relative;
}

.ah-slide {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--ah-gap);
  align-items: end;
}

.ah-js .ah-slide {
  position: absolute;
  inset: 0 0 auto 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.1s ease, visibility 1.1s;
}

.ah-js .ah-slide.is-on {
  position: relative;
  opacity: 1;
  visibility: visible;
}

.ah-slide:not(:first-child) {
  margin-top: 64px;
}

.ah-js .ah-slide:not(:first-child) {
  margin-top: 0;
}

.ah-slide__room {
  grid-column: 1 / span 8;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e2e0dc;
}

.ah-js .ah-slide__room img {
  transform: scale(1.06);
  transition: transform 7s ease;
}

.ah-js .ah-slide.is-on .ah-slide__room img {
  transform: scale(1);
}

.ah-slide__side {
  grid-column: 9 / span 4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.ah-slide__side .ah-eyebrow {
  margin: 0;
}

.ah-slide__detail {
  width: 100%;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  background: #ecebe8;
}

.ah-slide__name {
  font-size: clamp(28px, 2.6vw, 38px);
  line-height: 1.15;
}

.ah-focus__nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 28px;
}

.ah-focus__count {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ah-muted);
  min-width: 56px;
}

.ah-focus__ticks {
  display: flex;
  gap: 8px;
  flex: 1;
  max-width: 280px;
}

.ah-focus__ticks button {
  flex: 1;
  height: 16px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  position: relative;
}

.ah-focus__ticks button::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 7px;
  height: 1px;
  background: var(--ah-line);
}

.ah-focus__ticks i {
  position: absolute;
  left: 0;
  top: 7px;
  height: 1px;
  width: 0;
  background: var(--ah-ink);
}

.ah-focus__ticks button.is-done i {
  width: 100%;
}

.ah-focus__ticks button.is-run i {
  animation: ah-bar var(--ah-speed, 6s) linear forwards;
}

@keyframes ah-bar {
  to {
    width: 100%;
  }
}

.ah-focus__arr {
  background: none;
  border: 1px solid var(--ah-line);
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: var(--ah-ink);
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.ah-focus__arr:hover,
.ah-focus__arr:focus-visible {
  border-color: var(--ah-ink);
}

@media (max-width: 899px) {

  .ah-slide__room,
  .ah-slide__side {
    grid-column: 1 / -1;
  }

  .ah-slide__detail {
    display: none;
  }
}

/* ---------- studio ---------- */
.ah-studio {
  background: var(--ah-stone);
}

.ah-studio__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--ah-gap);
  align-items: center;
}

.ah-studio__img {
  grid-column: 1 / span 5;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #cfcac3;
}

.ah-studio__copy {
  grid-column: 7 / span 5;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.ah-studio__copy .ah-eyebrow {
  margin: 0;
}

.ah-studio__grid--text .ah-studio__copy {
  grid-column: 1 / span 7;
}

@media (max-width: 899px) {

  .ah-studio__img,
  .ah-studio__copy,
  .ah-studio__grid--text .ah-studio__copy {
    grid-column: 1 / -1;
  }
}

/* ---------- working with us ---------- */
.ah-ways__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--ah-gap);
}

@media (max-width: 899px) {
  .ah-ways__cols {
    grid-template-columns: 1fr;
  }
}

.ah-way {
  border-top: 1px solid var(--ah-ink);
  padding-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.ah-way__title {
  font-size: 26px;
  line-height: 1.2;
}

.ah-way .ah-textlink {
  margin-top: 6px;
}

/* ---------- no motion for visitors who ask for less ---------- */
@media (prefers-reduced-motion: reduce) {

  .ah-js .ah-piece,
  .ah-js .ah-piece__frame img,
  .ah-js .ah-slide,
  .ah-js .ah-slide__room img,
  .ah-hero__cap {
    transition: none !important;
    transform: none !important;
    filter: none !important;
  }

  .ah-js .ah-piece {
    opacity: 1;
  }

  .ah-js .ah-piece__frame {
    animation: none;
  }
}
