/* Photo Gallery – frontend styles */

/* Force [hidden] to actually hide elements, even if the theme overrides it. */
.pgal-lightbox[hidden] {
  display: none !important;
}

/* ---------- Landing page: event cards ---------- */
.pgal-events-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 1.5rem 0;
}

@media (max-width: 900px) {
  .pgal-events-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .pgal-events-grid { grid-template-columns: 1fr; }
}

.pgal-event-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pgal-event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.pgal-event-card-img {
  position: relative;
  width: 100%;
  padding-top: 66%;
  overflow: hidden;
  background: #f3f4f6;
}

.pgal-event-card-img img {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
}

.pgal-event-card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-style: italic;
  font-size: 0.9rem;
}

.pgal-event-card-info {
  padding: 1rem 1.25rem;
}

.pgal-event-card-info h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  color: #1f2937;
  line-height: 1.3;
}

.pgal-event-card-date {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
}

/* ---------- Individual event page ---------- */
.pgal-event-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.pgal-event-header {
  text-align: center;
  margin-bottom: 2rem;
}

.pgal-event-header h1 {
  margin: 0 0 0.4rem;
}

.pgal-event-date {
  color: #6b7280;
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
}

.pgal-event-description {
  max-width: 700px;
  margin: 1rem auto;
  color: #374151;
  line-height: 1.6;
}

.pgal-event-back {
  margin: 1rem 0 0;
  font-size: 0.9rem;
}

.pgal-event-back a {
  color: #6b7280;
  text-decoration: none;
}

.pgal-event-back a:hover {
  text-decoration: underline;
}

/* ---------- Photo grid on event page ---------- */
.pgal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

@media (max-width: 900px) {
  .pgal-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
  .pgal-grid { grid-template-columns: repeat(2, 1fr); }
}

.pgal-thumb {
  position: relative;
  width: 100%;
  padding: 0;
  padding-top: 100%;
  overflow: hidden;
  background: #f3f4f6;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.pgal-thumb:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pgal-thumb:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.pgal-thumb img {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
}

.pgal-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
  font-style: italic;
}

/* ---------- Lightbox ---------- */
.pgal-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.pgal-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.6rem;
  z-index: 1;
}

.pgal-lightbox-close:hover { opacity: 0.7; }

.pgal-lightbox-prev,
.pgal-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.pgal-lightbox-prev:hover,
.pgal-lightbox-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

.pgal-lightbox-prev { left: 1rem; }
.pgal-lightbox-next { right: 1rem; }

.pgal-lightbox-content {
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.pgal-lightbox-content img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.pgal-lightbox-caption {
  color: #fff;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.85;
  margin: 0;
}
