/**
 * @file
 * Gallery module styles - Simplified and clean.
 */

/* ========================================
   PAGE TITLE
   ======================================== */

.view-gallery-years .view-header,
.view-gallery-years .view-title,
.view-gallery-years h1 {
  text-align: center !important;
  font-size: 2.5rem !important;
  font-weight: 700 !important;
  color: #2c3e50 !important;
  margin: 2rem 0 !important;
  padding: 1rem 0 !important;
  text-transform: capitalize !important;
}

.view-gallery-events-by-year .view-header,
.view-gallery-events-by-year .view-title,
.view-gallery-events-by-year h1 {
  text-align: center !important;
  font-size: 2.5rem !important;
  font-weight: 700 !important;
  color: #2c3e50 !important;
  margin: 2rem 0 !important;
  padding: 1rem 0 !important;
}

/* ========================================
   GRID LAYOUT - Both Years and Events
   ======================================== */

/* Force grid layout for all gallery views */
.gallery_years-grid,
.gallery_events_by_year-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 1.5rem !important;
  padding: 0 0 2rem 0 !important;
  margin: 0 !important;
  list-style: none !important;
  width: 100% !important;
}

/* Prevent child elements from stretching */
.gallery_years-grid > *,
.gallery_events_by_year-grid > * {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  grid-column: auto !important;
}

/* Responsive - 2 columns on mobile */
@media (max-width: 768px) {
  .gallery_years-grid,
  .gallery_events_by_year-grid,
  .gallery-images-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }
}

/* ========================================
   BOOTSTRAP OVERRIDE - Gallery Pages Only
   ======================================== */

body[class*="gallery"] .main-content > .container,
body.page-route-view-gallery-events-by-year-page-1 .main-content > .container,
body.page-route-view-gallery-years-page-1 .main-content > .container {
  max-width: 100% !important;
  padding: 1rem 2rem !important;
}

body[class*="gallery"] .main-content > .container > .row,
body.page-route-view-gallery-events-by-year-page-1 .main-content > .container > .row,
body.page-route-view-gallery-years-page-1 .main-content > .container > .row {
  display: block !important;
  margin: 0 !important;
}

body[class*="gallery"] .main-content > .container > .row > .col-md-12,
body.page-route-view-gallery-events-by-year-page-1 .main-content > .container > .row > .col-md-12,
body.page-route-view-gallery-years-page-1 .main-content > .container > .row > .col-md-12 {
  padding: 0 !important;
  margin: 0 !important;
}

/* ========================================
   YEAR CARDS - Similar to Event Cards
   ======================================== */

.gallery-year-card {
  background: white !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  display: flex !important;
  flex-direction: column !important;
  transition: all 0.3s ease;
  height: 100%;
}

.gallery-year-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

/* Year name display - matches event image area */
.gallery-year-card .year-item {
  height: 280px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}

.gallery-year-card .year-item h2 {
  color: white;
  font-size: 3.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  margin: 0;
  padding: 0;
}

/* Year button - matches event button */
.gallery-year-card .year-link-wrapper {
  margin-top: auto;
  padding: 0;
}

.gallery-year-card .year-button {
  padding: 0.625rem 0.75rem;
  text-align: center;
  background: #007bff;
  color: white !important;
  text-decoration: none;
  display: block;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.85rem;
  border-radius: 0 0 12px 12px;
  margin: 0;
  border: none;
  width: 100%;
}

.gallery-year-card .year-button:hover {
  background: #0056b3;
  text-decoration: none;
  color: white !important;
}

/* ========================================
   EVENT CARDS
   ======================================== */

.gallery-event-item {
  background: white !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  display: flex !important;
  flex-direction: column !important;
  transition: all 0.3s ease;
  height: 100%;
}

.gallery-event-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

.gallery-event-item .event-title,
.gallery-event-item .views-field-title {
  order: 1;
  padding: 0.625rem 0.75rem;
  background: #f8f9fa;
  margin: 0;
}

.gallery-event-item .event-title h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.gallery-event-item .event-title a {
  color: #333;
  text-decoration: none;
}

.gallery-event-item .event-title a:hover {
  color: #007bff;
}

.gallery-event-item .views-field-field-gallery-images {
  order: 2;
  height: 280px;
  overflow: hidden;
  background: #f0f0f0;
}

.gallery-event-item .views-field-field-gallery-images img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.gallery-event-item .views-field-field-event-date {
  order: 3;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: #666;
  border-top: 1px solid #e9ecef;
}

.gallery-event-item .date-label {
  font-weight: 600;
  color: #333;
  margin-right: 0.5rem;
}

.gallery-event-item .event-date {
  color: #28a745;
  font-weight: 500;
}

.gallery-event-item .view-event-link,
.gallery-event-item .views-field-view-node {
  order: 4;
  padding: 0.625rem 0.75rem;
  text-align: center;
  background: #007bff;
  color: white;
  text-decoration: none;
  display: block;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.85rem;
  margin-top: auto;
  border-radius: 0 0 12px 12px;
}

.gallery-event-item .view-event-link a,
.gallery-event-item .views-field-view-node a {
  color: white;
  text-decoration: none;
}

.gallery-event-item .view-event-link:hover,
.gallery-event-item .views-field-view-node:hover {
  background: #0056b3;
}

/* ========================================
   GALLERY EVENT NODE PAGE
   ======================================== */

.node--type-gallery-event {
  padding: 2rem;
}

.gallery-event__title {
  font-size: 2.5rem;
  color: #333;
  margin-bottom: 1rem;
}

.gallery-event__meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: #666;
}

.gallery-event__description {
  margin-bottom: 2rem;
  font-size: 1.1rem;
  line-height: 1.6;
  color: #555;
}

/* Gallery Images Grid on Node Page */
.gallery-images-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 1.5rem !important;
  margin-top: 2rem;
  padding: 0;
  list-style: none;
}

.gallery-image-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-image-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gallery-image-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* ========================================
   BREADCRUMB
   ======================================== */

.gallery-breadcrumb {
  margin-bottom: 2rem;
  padding: 0;
  background: transparent;
  border-radius: 0;
  text-align: left;
}

.gallery-breadcrumb a {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.gallery-breadcrumb a:hover {
  color: #0056b3;
  text-decoration: none;
}

/* ========================================
   EMPTY STATE
   ======================================== */

.view-empty {
  text-align: center;
  padding: 3rem 2rem;
  background: #f8f9fa;
  border-radius: 12px;
  margin: 2rem 0;
}

.view-empty p {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 1rem;
}

.view-empty a {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}

.view-empty a:hover {
  text-decoration: underline;
  color: #0056b3;
}

/* ========================================
   GALLERY EVENT IMAGES BLOCK
   ======================================== */

/* Override Bootstrap container for gallery blocks */
.gallery-section .container {
  max-width: 1200px !important;
  padding: 0 15px !important;
  margin: 0 auto !important;
}

.block-views-blockgallery-event-images-block-block-1 .view-content {
  max-width: 100% !important;
  padding: 0 !important;
}

.view-gallery-event-images-block .view-content {
  width: 100% !important;
  max-width: 100% !important;
}

.gallery-event-images-block-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 2rem !important;
  padding: 2rem 0 !important;
  margin: 0 !important;
  list-style: none !important;
  width: 100% !important;
}

.gallery-event-images-block-grid > .views-field,
.gallery-event-images-block-grid > .views-field-field-gallery-images {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  grid-column: span 1 !important;
  flex: none !important;
  display: block !important;
}

.gallery-event-images-block-grid .field-content {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  position: relative !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
  border-radius: 12px !important;
  background: #f8f9fa !important;
}

.gallery-event-images-block-grid a {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  position: relative !important;
  overflow: hidden !important;
  border-radius: 12px !important;
}

.gallery-event-images-block-grid img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.gallery-event-images-block-grid a:hover img {
  transform: scale(1.08) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25) !important;
}

/* Responsive grid for smaller screens */
@media (max-width: 992px) {
  .gallery-event-images-block-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.5rem !important;
  }
}

@media (max-width: 768px) {
  .gallery-event-images-block-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  .gallery-section .container {
    padding: 0 10px !important;
  }
}

@media (max-width: 480px) {
  .gallery-event-images-block-grid {
    grid-template-columns: repeat(1, 1fr) !important;
  }
}

/* SEE MORE link */
.gallery-block-view-more {
  text-align: center;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid #e9ecef;
}

.gallery-block-view-more .btn {
  display: inline-block;
  padding: 1rem 3rem;
  background: #3d4d5c;
  color: white !important;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.gallery-block-view-more .btn:hover {
  background: #2c3a47;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  color: white !important;
}

/* Responsive for images block */
@media (max-width: 768px) {
  .gallery-event-images-block-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  .gallery-image-block-item img {
    height: 200px;
  }

  .gallery-block-view-more {
    margin-top: 1.5rem;
  }
}
