/* ==========================================================================
   GALLERY PAGE STYLES
   Extracted from main style.css for modular architecture
   ========================================================================== */

/* ==========================================================================
   RESPONSIVE SITE TITLE POSITIONING
   Fix site title positioning at mobile breakpoints
   ========================================================================== */

@media (max-width: 768px) {
  .page-template-page-gallery .site-title {
    top: 20px !important;
    left: 20px !important;
    position: fixed !important;
  }
}

/* Remove flex interference - let grid handle everything */
.gallery-content {
  width: 100% !important;
  margin: 0 !important;
  padding: 20px 0 !important;
}

/* ==========================================================================
   GALLERY SHOWCASE GRID SYSTEM
   Nuclear option with maximum specificity for reliable layout
   ========================================================================== */

/* Desktop - 3 columns (default) */
body .gallery-showcase,
html body .gallery-showcase,
.site .gallery-showcase,
#page .gallery-showcase,
body.page-template-page-gallery .gallery-showcase {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 25px !important;
  margin: 50px auto !important;
  max-width: 1200px !important;
  width: 90% !important;
  min-height: auto !important;
  grid-gap: 25px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  position: relative !important;
  left: auto !important;
  right: auto !important;
}

/* Large tablet - spacing adjustment to prevent overflow at 1310px */
@media (max-width: 1310px) and (min-width: 1025px) {
  body .gallery-showcase,
  html body .gallery-showcase,
  .site .gallery-showcase,
  #page .gallery-showcase,
  body.page-template-page-gallery .gallery-showcase {
    gap: 20px !important;
    margin: 40px auto !important;
  }
}

/* Tablet - 2 columns */
@media (max-width: 1024px) and (min-width: 701px) {
  body .gallery-showcase,
  html body .gallery-showcase,
  .site .gallery-showcase,
  #page .gallery-showcase,
  body.page-template-page-gallery .gallery-showcase {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 25px !important;
    margin: 50px auto !important;
    max-width: 900px !important;
    width: 90% !important;
    min-height: auto !important;
  }
}

/* Mobile - 1 column */
@media (max-width: 700px) {
  body .gallery-showcase,
  html body .gallery-showcase,
  .site .gallery-showcase,
  #page .gallery-showcase,
  body.page-template-page-gallery .gallery-showcase {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    margin: 30px auto !important;
    max-width: 500px !important;
    width: 95% !important;
    min-height: auto !important;
  }
}

/* ==========================================================================
   ULTIMATE GALLERY SHOWCASE OVERRIDE
   Maximum override power - placed at end for ultimate precedence
   ========================================================================== */

/* ULTIMATE GALLERY SHOWCASE OVERRIDE - NOTHING CAN OVERRIDE THIS */
html body.page-template-page-gallery #page .gallery-showcase,
html body.page-template-page-gallery .site .gallery-showcase,
html body.page-template-page-gallery .gallery-showcase {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 25px !important;
  margin: 50px auto !important;
  max-width: 1200px !important;
  width: 90% !important;
  min-height: auto !important;
  grid-gap: 25px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  position: relative !important;
  left: auto !important;
  right: auto !important;
}

/* TABLET OVERRIDE */
@media (max-width: 1024px) and (min-width: 701px) {
  html body.page-template-page-gallery #page .gallery-showcase,
  html body.page-template-page-gallery .site .gallery-showcase,
  html body.page-template-page-gallery .gallery-showcase {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 25px !important;
    margin: 50px auto !important;
    max-width: 900px !important;
    width: 90% !important;
  }
}

/* MOBILE OVERRIDE */
@media (max-width: 700px) {
  html body.page-template-page-gallery #page .gallery-showcase,
  html body.page-template-page-gallery .site .gallery-showcase,
  html body.page-template-page-gallery .gallery-showcase {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    margin: 30px auto !important;
    max-width: 500px !important;
    width: 95% !important;
  }
}

/* ==========================================================================
   GALLERY SUBTITLE ALIGNMENT
   Override dashboard-header center alignment for Gallery subtitle
   ========================================================================== */

/* Gallery page subtitle left alignment override */
.page-template-page-gallery .dashboard-header {
  text-align: left !important;
}

/* Keep title centered but make subtitle left-aligned */
.page-template-page-gallery .dashboard-title h1 {
  text-align: center !important;
  font-size: 3.5em !important;
}

.page-template-page-gallery .dashboard-subtitle {
  text-align: left !important;
}

/* ==========================================================================
   GALLERY MODAL IMPROVEMENTS
   Better padding and spacing for optimal image display
   ========================================================================== */

/* Improve modal image container padding for better spacing */
.page-template-page-gallery .lightbox-image-container {
  padding: 30px 20px 40px 20px !important; /* More bottom padding to prevent image cutoff */
}

/* Optimize modal image sizing for better spacing */
.page-template-page-gallery .lightbox-image {
  max-width: 85% !important; /* Slightly smaller to ensure better spacing */
  max-height: 85% !important; /* Slightly smaller to ensure proper bottom spacing */
}

/* ==========================================================================
   GALLERY PAGE CARD LAYOUT
   Extracted from page-gallery.php inline styles
   ========================================================================== */

.gallery-page-content {
  padding: 5% 3%;
  max-width: 1400px;
  margin: 0 auto;
}

.gallery-header {
  text-align: center;
  margin-bottom: 4%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 3% 2%;
}

/* Final edge-flicker hardening for gallery threshold blocks. */
.page-template-page-gallery .gallery-header,
.page-template-page-gallery .gallery-footer {
  background: rgba(11, 18, 32, 0.88) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  transition: none !important;
  animation: none !important;
  box-shadow: none !important;
  contain: paint;
}

.gallery-title {
  font-size: 2.5rem;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 1%;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.gallery-subtitle {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  font-weight: 400;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2.5vw, 28px);
  margin-bottom: 4%;
}

.gallery-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 0;
  transition: all 0.3s ease;
  overflow: visible;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gallery-card:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.2);
}

.gallery-image-container {
  width: 100%;
  height: 250px;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-card:hover .gallery-image {
  transform: none;
}

.image-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  backdrop-filter: blur(10px);
}

.page-template-page-gallery .image-overlay {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.gallery-image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.placeholder-hint {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  margin-top: 5px;
  font-style: italic;
}

.gallery-status {
  padding: 2% 4%;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.gallery-status:not(.pending) {
  background: rgba(129, 212, 250, 0.2);
  border: 1px solid rgba(129, 212, 250, 0.35);
  color: #81d4fa;
}

.gallery-status.pending {
  background: rgba(255, 193, 7, 0.2);
  border: 1px solid rgba(255, 193, 7, 0.3);
  color: #ffc107;
}

.has-image {
  border-color: rgba(129, 212, 250, 0.35);
}

.empty-card {
  border-color: rgba(255, 193, 7, 0.3);
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  opacity: 0.7;
}

.placeholder-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  margin: 0;
  text-align: center;
}

.gallery-card-content {
  padding: 6%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 210px;
}

.gallery-card-title {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 3%;
  font-weight: 600;
}

.gallery-card-description {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0;
}

.gallery-card-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-bottom: 2px;
}

.gallery-tag,
.gallery-date {
  padding: 2% 4%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.gallery-footer {
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 3%;
}

.gallery-footer-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  margin: 0;
  font-style: italic;
}

@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(14px, 2.8vw, 22px);
  }

  .gallery-page-content {
    padding: 4% 3%;
    padding-bottom: 120px;
  }

  .gallery-title {
    font-size: 2.2rem;
  }

  .gallery-card-content {
    min-height: 190px;
  }
}

@media (max-width: 768px) {
  body.page-template-page-gallery,
  body.page-template-page-gallery #primary,
  body.page-template-page-gallery #main,
  body.page-template-page-gallery .content-area,
  body.page-template-page-gallery .site-main,
  body.page-template-page-gallery .gallery-page-content {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .gallery-page-content {
    padding: 4% 2%;
  }

  .gallery-title {
    font-size: 2rem;
  }

  .gallery-subtitle {
    font-size: 1.1rem;
  }

  .gallery-header {
    padding: 4% 3%;
  }

  .gallery-card-content {
    padding: 8%;
    min-height: 180px;
  }

  .gallery-image-container {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .gallery-page-content {
    padding: 3% 1.5%;
  }

  .gallery-title {
    font-size: 1.8rem;
  }

  .gallery-card-title {
    font-size: 1.2rem;
  }

  .gallery-image-container {
    height: 180px;
  }

  .gallery-card-content {
    min-height: 170px;
  }
}

