/* Gallery Page Styles */

/* Gallery-specific overrides */
.sign-content {
  max-width: none !important;
  width: auto !important;
}

/* Gallery card content styles */
.sign-image {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 1rem;
  color: currentColor;
  opacity: 0.4;
  font-family: "Highway Gothic", "Arial Narrow", sans-serif;
  font-size: 0.9rem;
}

.back-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card-info {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid currentColor;
}

.card-title {
  font-family: "Highway Gothic", "Arial Narrow", sans-serif;
  font-size: 1.6rem;
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  line-height: 1.2;
}

.card-meta {
  font-size: 1.2rem;
  opacity: 0.8;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-meta div {
  margin: 0;
}

.card-meta .meta-location {
  text-align: left;
  flex: 1;
  min-width: 60%;
}

.card-meta .meta-date {
  margin-left: auto;
  padding-left: 0.5rem;
  text-align: right;
}

.back-image {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #f0f0f0;
}

/* Gallery grid layout - Desktop: 2 columns with fixed size cards */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 320px);
  gap: 2rem;
  margin: 2rem 0;
  padding: 0 1rem;
  width: 100%;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

.gallery-grid.layout-ready {
  opacity: 1;
}

.gallery-item {
  display: block;
  perspective: 1000px;
  width: 320px;
  height: 480px;
  cursor: pointer;
}

.gallery-item:hover .card-flipper:not(.flipped) {
  transform: rotateY(15deg);
}

/* Card flip animations */
.card-flipper {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

/* Disable transition initially to prevent flip animation on load */
.card-flipper:not(.transition-enabled) {
  transition: none !important;
}

.card-flipper.flipped {
  transform: rotateY(180deg);
}

.gallery-item:first-child .card-flipper.hint {
  animation: hint-flip 0.8s ease-in-out;
}

@keyframes hint-flip {
  0% {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(45deg);
  }
  100% {
    transform: rotateY(0deg);
  }
}

/* Reduce motion for accessibility and performance */
@media (prefers-reduced-motion: reduce) {
  .card-flipper {
    transition: none !important;
  }

  .gallery-item:first-child .card-flipper.hint {
    animation: none !important;
  }

  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Card faces */
.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.card-front {
  z-index: 2;
  background: transparent;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15))
    drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  overflow: visible;
}

.card-back {
  transform: rotateY(180deg);
  border: 2px solid currentColor;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* Gallery Post Page Styles */

/* Main layout container */
.post-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
  align-items: start;
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

.post-layout.layout-ready {
  opacity: 1;
}

/* Hero section - main digital design */
.hero-section {
  position: relative;
}

.hero-image-wrapper {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  border: 3px solid currentColor;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
  padding: 1rem;
}

.hero-image-wrapper:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.hero-label {
  background: currentColor;
  color: var(--sign-bg);
  padding: 0.75rem;
  text-align: center;
  font-family: "Highway Gothic", "Arial Narrow", sans-serif;
  font-size: 1.1rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hero-image {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
}

/* Sidebar content */
.post-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Info section - matches gallery card meta */
.post-info {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid currentColor;
  border-radius: 6px;
  padding: 0.75rem;
  font-size: 1.2rem;
  opacity: 0.8;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-info .meta-location {
  text-align: left;
  flex: 1;
  min-width: 60%;
}

.post-info .meta-date {
  margin-left: auto;
  padding-left: 0.5rem;
  text-align: right;
}

/* Photo section */
.photo-section {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid currentColor;
  border-radius: 6px;
  overflow: hidden;
}

.photo-wrapper {
  position: relative;
}

.photo-image {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.photo-image:hover {
  transform: scale(1.02);
}

/* Description section */
.description-section {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid currentColor;
  border-radius: 6px;
  padding: 1.5rem;
}

.description-title {
  font-family: "Highway Gothic", "Arial Narrow", sans-serif;
  font-size: 1.1rem;
  text-transform: uppercase;
  margin: 0 0 1rem 0;
  color: currentColor;
  letter-spacing: 0.05em;
}

.description-content {
  font-size: 1rem;
  line-height: 1.5;
}

.description-content p {
  margin: 0.5rem 0;
}

/* Modal styles - Full viewport overlay */
.modal {
  display: none;
  position: fixed;
  z-index: 99999; /* Higher than any other element */
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.98);
  cursor: pointer;
  backdrop-filter: blur(2px);
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 95vw;
  max-height: 95vh;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  object-fit: contain;
}

.close {
  position: fixed;
  top: 20px;
  right: 40px;
  color: #ffffff;
  font-size: 50px;
  font-weight: bold;
  cursor: pointer;
  z-index: 100000;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  transition: color 0.2s ease;
}

.close:hover {
  color: #cccccc;
}

/* JavaScript-based responsive layout (measures actual visual size) */
.gallery-grid.mobile-layout {
  grid-template-columns: 400px !important;
  gap: 1.5rem;
  padding: 0 1rem;
}

.gallery-grid.mobile-layout .gallery-item {
  width: 400px !important;
  height: 600px !important;
}

/* Mobile uses same layout as desktop - no special mobile layout needed */
