/* Navarasa section styles - uses colour tokens from :root in styles.css
   Visual pairing with the Mohiniyattam stills section (styles.css .mohini block).
   Lightbox reuses the .g-lightbox component classes from gallery-styles.css. */

/* ---- Section ---- */
.navarasa { background: var(--paper); }

/* ---- Grid ---- */
.navarasa-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;            /* same container width as the heading */
  margin: 0;
  padding: 0;
}
.navarasa-tile {
  position: relative;
  aspect-ratio: 2 / 3;    /* the photos are portrait; this avoids cropping the face and hands */
  overflow: hidden;
  border-radius: 16px;
  margin: 0;
  background: #2a1a14;
  cursor: pointer;
  outline: none;
}
.navarasa-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  z-index: 1;
}
@media (max-width: 1023px) { .navarasa-grid { gap: 14px; } }
@media (max-width: 639px) {
  .navarasa-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .navarasa-tile:last-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
}

/* ---- Number badge (same treatment as the Mohiniyattam stills) ---- */
.navarasa-tile .m-card-badge { z-index: 3; }

/* ---- Overlay: rasa name, emotion, caption ---- */
.navarasa-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  padding: 1.1rem 1.15rem 1.05rem;
  background: linear-gradient(180deg, rgba(40, 10, 15, 0) 42%, rgba(40, 10, 15, 0.85) 100%);
  pointer-events: none;
}
.navarasa-text {
  display: flex;
  flex-direction: column;
}
.navarasa-rasa {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.1;
  color: #fff;
}
.navarasa-emotion {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-top: 0.2rem;
}
.navarasa-caption {
  margin: 0.4rem 0 0;
  font-size: 0.83rem;
  line-height: 1.4;
  color: rgba(244, 233, 218, 0.88);
}

/* Keyboard focus ring for tiles */
.navarasa-tile:focus-visible {
  box-shadow: 0 0 0 3px var(--gold);
}

/* ---- Hover (pointer devices only) ---- */
@media (hover: hover) {
  .navarasa-tile img { transition: transform 400ms ease; }
  .navarasa-tile:hover img { transform: scale(1.04); }
  .navarasa-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 34px -14px rgba(42, 15, 17, 0.45);
  }
  /* rasa name always visible; caption appears on hover */
  .navarasa-caption {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 350ms ease, transform 350ms ease;
  }
  .navarasa-tile:hover .navarasa-caption {
    opacity: 1;
    transform: none;
  }
}
/* Touch devices: caption always visible (no hiding rules apply) */

/* ---- Scroll reveal: staggered fade-in, 60ms per tile ----
   Tiles are picked up by the site's IntersectionObserver in script.js.
   transform is reserved for the hover lift, so the reveal is a pure fade. */
.navarasa-tile.reveal {
  transform: none;
  transition: opacity 0.75s var(--ease), transform 400ms var(--ease), box-shadow 400ms var(--ease);
  transition-delay: var(--rvl-delay, 0s), 0s, 0s;
}
.navarasa-tile.reveal.is-visible { transform: none; }
.navarasa-tile[data-delay="60"]  { --rvl-delay: 0.06s; }
.navarasa-tile[data-delay="120"] { --rvl-delay: 0.12s; }
.navarasa-tile[data-delay="180"] { --rvl-delay: 0.18s; }
.navarasa-tile[data-delay="240"] { --rvl-delay: 0.24s; }
.navarasa-tile[data-delay="300"] { --rvl-delay: 0.30s; }
.navarasa-tile[data-delay="360"] { --rvl-delay: 0.36s; }
.navarasa-tile[data-delay="420"] { --rvl-delay: 0.42s; }
.navarasa-tile[data-delay="480"] { --rvl-delay: 0.48s; }
@media (prefers-reduced-motion: reduce) {
  .navarasa-tile.reveal { transition: none; }
}

/* ---- Lightbox details (structure reuses .g-lightbox / .g-lb-* classes) ---- */
.g-lb-counter .n-lb-current {
  color: #fff;
  font-weight: 600;
}
.g-lb-caption .n-lb-rasa {
  display: block;
}
.g-lb-caption .n-lb-emotion {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
