/* Reusable parts: buttons, notice, idol cards, size ruler, idol pop-up. */

/* shared */
.view {
  padding-bottom: 40px;
  animation: view-in 0.45s ease both;
}
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .view {
    animation: none;
  }
}
.sec {
  padding-block: 34px 10px;
}
.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 18px;
}
.sec-head h2 {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(1.55rem, 4vw, 2.2rem);
}
.sec-head p {
  margin: 0;
  color: var(--muted);
}
.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--kumkum);
  font-weight: 600;
  margin: 0 0 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1.5px solid var(--btn-bg);
  background: var(--btn-bg);
  color: var(--btn-fg);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  min-height: 46px;
  max-width: 100%;
  text-align: center;
  text-wrap: balance;
}
html[lang="ta"] .btn {
  font-size: 0.92rem;
  padding-inline: 16px;
  line-height: 1.35;
}
.btn:hover {
  filter: brightness(1.08);
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--muted);
}
.btn.small {
  padding: 8px 14px;
  min-height: 40px;
  font-size: 0.92rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.actions--after {
  margin-top: 20px;
}
.linkbtn {
  background: none;
  border: 0;
  padding: 6px 0;
  color: var(--link);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}

.notice {
  margin: 22px 0 0;
  padding: 14px 16px;
  border: 1.5px solid var(--kumkum);
  border-radius: 14px;
  background: var(--surface);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 60ch;
  overflow-wrap: anywhere;
}
.notice b {
  display: block;
  color: var(--kumkum);
  margin-bottom: 2px;
}
.notice.wide {
  max-width: none;
  margin: 0 0 16px;
}

.booking-line {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--turmeric);
  background: color-mix(in srgb, var(--turmeric) 14%, var(--surface));
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
html[lang="ta"] .booking-line {
  font-size: 0.92rem;
  line-height: 1.55;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 0 0 16px;
}
.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
}
.filter-label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.year-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 40px;
  white-space: nowrap;
}
.chip[aria-pressed="true"] {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-fg);
}
html[lang="ta"] .chip {
  font-size: 0.82rem;
  padding: 8px 12px;
  white-space: normal;
  text-align: center;
  max-width: 100%;
}

/* cards */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (min-width: 760px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 10px 14px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
  min-width: 0;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--turmeric);
  box-shadow: 0 14px 28px rgba(42, 20, 24, 0.08);
}
.card:focus-visible {
  outline-offset: 3px;
}
.pic {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--glow-a), var(--glow-b));
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 8px;
}
.pic img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.35s ease;
}
.card:hover .pic img {
  transform: scale(1.04);
}
.pic svg {
  width: 58%;
  height: auto;
  color: var(--sil);
}
.pic-count {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  background: rgba(20, 8, 10, 0.72);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}


.tag {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  background: var(--surface);
  color: var(--kumkum);
  border: 1px solid var(--kumkum);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  letter-spacing: 0.02em;
  max-width: calc(100% - 28px);
  overflow-wrap: anywhere;
  line-height: 1.25;
}
html[lang="ta"] .tag {
  font-size: 0.65rem;
}
.name {
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
html[lang="ta"] .name {
  font-size: 0.95rem;
  line-height: 1.45;
}
.id-line,
.year-line {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.meta {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
html[lang="ta"] .meta {
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ruler */
.ruler-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 16px 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.ruler {
  justify-content: center;
  --k: 17px;
  --lab: 32px;
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: calc(10 * var(--k) + var(--lab) + 4px);
  min-width: 300px;
}
@media (max-width: 420px) {
  .ruler {
    --k: 14px;
    gap: 4px;
  }
  .bar .lab {
    font-size: 0.88rem;
  }
}
.bar {
  flex: 1 1 0;
  min-width: 0;
  max-width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.bar .col {
  width: 100%;
  height: calc(var(--ft) * var(--k));
  border-radius: 50% 50% 6px 6px/22px 22px 6px 6px;
  background: linear-gradient(180deg, var(--glow-a), var(--glow-b));
  border: 1.5px solid transparent;
  display: grid;
  place-items: start center;
  padding-top: 8px;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.bar .col svg {
  width: 64%;
  max-width: 34px;
  height: auto;
  color: var(--sil);
}
.bar .lab {
  height: var(--lab);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 1rem;
  color: var(--muted);
}
.bar:hover .col {
  border-color: var(--turmeric);
}
.bar[aria-pressed="true"] {
  --cut: var(--turmeric);
}
.bar[aria-pressed="true"] .col {
  background: var(--turmeric);
  border-color: var(--kumkum);
}
.bar[aria-pressed="true"] .col svg {
  color: var(--on-turmeric);
}
.bar[aria-pressed="true"] .lab {
  color: var(--ink);
}
.avg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--lab) + 5.5 * var(--k));
  border-top: 1.5px dashed var(--muted);
  pointer-events: none;
}
.avg span {
  position: absolute;
  left: 0;
  bottom: 3px;
  font-size: 0.74rem;
  color: var(--muted);
  background: var(--surface);
  padding: 0 6px 0 0;
}
.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  margin: 10px 0 14px;
}

/* Thumbnail section */
.thumbnail-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.thumbnail-title {
  font-size: 1.1rem;
  margin: 0 0 16px;
  color: var(--ink);
  line-height: 1.4;
}

@media (max-width: 768px) {
  .thumbnail-title {
    font-size: 0.95rem;
  }
}

.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 768px) {
  .thumbnail-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .thumbnail-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
  }
}

.thumbnail-info-bottom {
  margin-top: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

#loadMoreBtn {
  display: none;
}

.thumbnail-item {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
  background: linear-gradient(180deg, var(--glow-a), var(--glow-b));
  padding: 0;
}

.thumbnail-item:hover {
  border-color: var(--turmeric);
  transform: scale(1.02);
}

.thumbnail-item.active {
  border-color: var(--kumkum);
  box-shadow: 0 0 0 3px rgba(142, 27, 46, 0.28);
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* modal lightbox */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(8, 3, 5, 0.94);
  padding: 0;
  overscroll-behavior: contain;
  touch-action: none;
}

.modal-close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: white;
  cursor: pointer;
  z-index: 50;
  display: grid;
  place-items: center;
  transition: background 0.2s;
  backdrop-filter: blur(10px);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.modal-close svg {
  width: 28px;
  height: 28px;
}

.modal-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: white;
  cursor: pointer;
  z-index: 45;
  display: grid;
  place-items: center;
  transition: background 0.2s, opacity 0.2s;
  backdrop-filter: blur(10px);
}

.modal-nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

.modal-nav svg {
  width: 28px;
  height: 28px;
}

.modal-nav.prev {
  left: max(12px, env(safe-area-inset-left, 0px));
}

.modal-nav.next {
  right: max(12px, env(safe-area-inset-right, 0px));
}

.modal-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-image-container {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 64px 72px 168px;
  min-height: 0;
  position: relative;
  user-select: none;
}

.modal-image-container img {
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  position: static !important;
  inset: auto !important;
  width: auto !important;
  height: auto !important;
  max-width: min(calc(100vw - 140px), calc((100dvh - 220px) * 0.75));
  max-height: min(calc(100dvh - 220px), calc((100vw - 140px) / 0.75));
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.modal-image-container svg {
  width: 220px;
  height: auto;
  color: rgba(255, 255, 255, 0.28);
}

.modal-filmstrip {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 78px;
  z-index: 42;
  display: flex;
  gap: 8px;
  justify-content: center;
  overflow-x: auto;
  padding: 0 16px 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.modal-filmstrip::-webkit-scrollbar {
  display: none;
}
.film-thumb {
  flex: 0 0 auto;
  width: 52px;
  height: 68px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  scroll-snap-align: center;
  opacity: 0.65;
  transition: opacity 0.2s, border-color 0.2s;
}
.film-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.film-thumb.active,
.film-thumb:hover {
  opacity: 1;
  border-color: var(--turmeric);
}

.modal-info {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.55), transparent);
  padding: 36px 20px max(18px, env(safe-area-inset-bottom, 0px));
  z-index: 41;
  pointer-events: none;
}

.modal-info-content {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.modal-info h3 {
  margin: 0 0 4px;
  font-size: 1.2rem;
  color: white;
}

.modal-info .meta {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.image-counter {
  display: inline-block;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  backdrop-filter: blur(8px);
}

@media (max-width: 768px) {
  .modal-close {
    width: 42px;
    height: 42px;
    min-height: 42px;
  }

  .modal-close svg {
    width: 22px;
    height: 22px;
  }

  .modal-nav {
    width: 42px;
    height: 42px;
    min-height: 42px;
    top: auto;
    bottom: max(148px, calc(env(safe-area-inset-bottom, 0px) + 148px));
    transform: none;
  }

  .modal-nav svg {
    width: 22px;
    height: 22px;
  }

  .modal-image-container {
    padding: 56px 16px 188px;
  }

  .modal-image-container img {
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 240px);
  }

  .modal-filmstrip {
    bottom: 70px;
  }

  .film-thumb {
    width: 44px;
    height: 58px;
  }

  .modal-info h3 {
    font-size: 1.05rem;
  }

  .modal-info .meta {
    font-size: 0.82rem;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .modal-filmstrip {
    display: none;
  }

  .modal-image-container {
    padding: 48px 88px 88px;
  }

  .modal-image-container img {
    max-width: min(calc(100vw - 180px), calc((100dvh - 120px) * 0.75));
    max-height: calc(100dvh - 120px);
  }

  .modal-nav {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
}

.notice--flush {
  margin: 0;
}

/* mobile quick actions */
.quickbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: none;
  gap: 10px;
  padding: 10px max(12px, env(safe-area-inset-left, 0px))
    max(10px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-right, 0px));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.quickbar .btn {
  flex: 1 1 0;
}
@media (max-width: 760px) {
  .quickbar {
    display: flex;
  }
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }
  .modal:not([hidden]) ~ .quickbar,
  body:has(.modal:not([hidden])) .quickbar {
    display: none;
  }
}
