/* app/styles.css */

/* ===== LT Museum Font Family ===== */

@font-face {
  font-family: "LT Museum";
  src: url("../assets/fonts/LTMuseum-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
}
@font-face {
  font-family: "LT Museum";
  src: url("../assets/fonts/LTMuseum-LightItalic.ttf") format("truetype");
  font-weight: 300;
  font-style: italic;
}

@font-face {
  font-family: "LT Museum";
  src: url("../assets/fonts/LTMuseum-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: "LT Museum";
  src: url("../assets/fonts/LTMuseum-MediumItalic.ttf") format("truetype");
  font-weight: 500;
  font-style: italic;
}

@font-face {
  font-family: "LT Museum";
  src: url("../assets/fonts/LTMuseum-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: "LT Museum";
  src: url("../assets/fonts/LTMuseum-BoldItalic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
}

@font-face {
  font-family: "LT Museum";
  src: url("../assets/fonts/LTMuseum-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
}
@font-face {
  font-family: "LT Museum";
  src: url("../assets/fonts/LTMuseum-BlackItalic.ttf") format("truetype");
  font-weight: 900;
  font-style: italic;
}

/* Optional: make UI match the cards */
body {
  margin: 0;
  min-height: 100vh;
  font-family: "LT Museum", system-ui, sans-serif;
  background:
    radial-gradient(circle at top, rgba(70, 80, 100, 0.18), transparent 36rem),
    #0e0f12;
  color: #f4f4f4;
}

.gallery-shell {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px 18px 40px;
}

.gallery-header {
  text-align: center;
}

.gallery-header h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 54px);
  letter-spacing: 0.04em;
}

.gallery-count {
  margin: 10px 0 0;
  color: #b9c0cc;
  font-weight: 700;
}


/* ===== Spirit Masters Public Gallery ===== */

body.modal-open {
  overflow: hidden;
}

#galleryControls {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(5, minmax(145px, 1fr));
  gap: 12px;
  padding: 24px 0 0;
  align-items: center;
}

#galleryControls input,
#galleryControls select {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(20, 22, 27, 0.92);
  color: white;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

#cardSearch {
  min-width: 220px;
}

#galleryCount {
  color: #b9c0cc;
  font-weight: 700;
}

#gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 24px;
  padding: 24px 0;
  align-items: start;
}

.gallery-card {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 13px;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.gallery-card:hover,
.gallery-card:focus-visible {
  transform: translateY(-4px);
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.35));
  outline: none;
}

.card-image-crop,
.modal-card-image-crop {
  overflow: hidden;
  background: transparent;
  border-radius: 12px;
}

.card-image-crop {
  width: 100%;
  aspect-ratio: 744 / 1039;
}

.card-thumb,
#modalCardImage {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

/* Normal rendered cards should now save without the extra black bleed rim.
   Do not scale the image here, because scaling a low-res thumbnail makes blur worse. */
.card-thumb {
  transform: none;
}

.missing-card-image {
  width: 100%;
  height: 100%;
  min-height: 300px;
  display: grid;
  place-items: center;
  background: #1b1b1b;
  color: white;
  border-radius: 12px;
}

.gallery-message {
  color: #f4f4f4;
  padding: 24px;
  grid-column: 1 / -1;
}

/* ===== Modal Card Viewer ===== */

.card-modal[hidden] {
  display: none;
}

.card-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.card-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(3px);
}

.card-modal-panel {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  margin: 16px auto;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 24px;
  background: #171717;
  color: white;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.55);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: white;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

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

.modal-card-image-crop {
  aspect-ratio: 744 / 1039;
  align-self: start;
}

#modalCardImage {
  transform: none;
}

.modal-card-info {
  padding-right: 34px;
}

.modal-card-info h2 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 44px);
}

.card-line {
  font-weight: 800;
  font-size: 1.05rem;
}

.modal-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.modal-meta p,
.credit-lines p {
  margin: 4px 0;
}

.stat-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 18px;
}

.stat-row span {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 6px 10px;
}

.effect-text {
  line-height: 1.45;
  font-size: 1.05rem;
}

.effect-text b {
  font-weight: 900;
}

.effect-text i,
.flavor-text {
  font-style: italic;
}

.flavor-text {
  opacity: 0.86;
  margin-top: 16px;
  line-height: 1.45;
}

.effect-text .inline-icon,
.effect-text .once-icon {
  display: inline;
  width: 1em;
  height: 1em;
  object-fit: contain;
  vertical-align: -0.15em;
  margin: 0 0.12em;
}

.effect-text .once-icon {
  width: 1.2em;
}

.credit-lines {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 0.95em;
  opacity: 0.82;
}

@media (max-width: 1000px) {
  #galleryControls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #cardSearch {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  #galleryControls {
    grid-template-columns: 1fr;
  }

  #cardSearch {
    grid-column: auto;
  }

  #gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    padding: 16px 0;
  }

  .card-modal-panel {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .modal-card-image-crop {
    max-width: 360px;
    width: 100%;
    margin: 0 auto;
  }

  .modal-card-info {
    padding-right: 0;
  }
}
