/* Project Gallery — searchable, paginated project grid */

#wrapper .project-gallery {
   position: relative;
}

#wrapper .project-gallery__search {
   display: flex;
   gap: 8px;
   margin-bottom: 50px;
   max-width: 956px;
   margin-left: auto;
   margin-right: auto;
}

#wrapper .project-gallery__search-input {
   flex: 1;
   height: 44px;
   padding: 0 16px;
   border: 1px solid #e5e7eb;
   border-radius: 4px;
   font-size: 14px;
   color: #16213e;
   margin-bottom: 0;
}

#wrapper .project-gallery__search-submit {
   display: flex;
   align-items: center;
   justify-content: center;
   width: 44px;
   height: 44px;
   flex: 0 0 auto;
   background-color: #fdecea;
   border: 1px solid #f3c8c4;
   border-radius: 4px;
   color: #e2231a;
   cursor: pointer;
   padding: 0;
   margin: 0;
   transition: background-color 0.2s ease;
}

#wrapper .project-gallery__search-submit:hover {
   background-color: #fadbd8;
}

#wrapper .project-gallery__search-submit:disabled {
   cursor: not-allowed;
   opacity: 0.6;
}

/* AJAX loading state */

#wrapper .project-gallery__results {
   position: relative;
   min-height: 120px;
}

#wrapper .project-gallery.is-loading .project-gallery__results {
   opacity: 0.35;
   pointer-events: none;
   transition: opacity 0.2s ease;
}

#wrapper .project-gallery__loader {
   display: none;
   align-items: center;
   justify-content: center;
   position: absolute;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   z-index: 2;
}

#wrapper .project-gallery.is-loading .project-gallery__loader {
   display: flex;
}

#wrapper .project-gallery__spinner {
   width: 36px;
   height: 36px;
   border: 3px solid #f3d4d2;
   border-top-color: #e2231a;
   border-radius: 50%;
   animation: project-gallery-spin 0.7s linear infinite;
}

@keyframes project-gallery-spin {
   to {
      transform: rotate(360deg);
   }
}

/* Grid of alternating blocks */

#wrapper .project-gallery__grid {
   display: flex;
   flex-direction: column;
   gap: 16px;
}

#wrapper .project-gallery__block {
   display: flex;
   flex-direction: column;
   gap: 16px;
}

#wrapper .project-gallery__block--partial {
   flex-direction: column;
}

#wrapper .project-gallery__stack {
   display: flex;
   flex-direction: column;
   gap: 16px;
}

/* Cards */

#wrapper .project-gallery__card {
   position: relative;
   display: block;
   border-radius: 4px;
   overflow: hidden;
   background-color: #1a1a1a;
}

#wrapper .project-gallery__card--large {
   min-height: 500px;
}

#wrapper .project-gallery__card--small {
   min-height: 240px;
}

#wrapper .project-gallery__card-link {
   position: absolute;
   inset: 0;
   display: block;
   text-decoration: none;
   color: inherit;
}

#wrapper .project-gallery__card-media {
   position: absolute;
   inset: 0;
   width: 100%;
   height: 100%;
   object-fit: cover;
   transition: transform 0.35s ease;
}

#wrapper .project-gallery__card:hover .project-gallery__card-media {
   transform: scale(1.04);
}

#wrapper .project-gallery__card-overlay {
   position: absolute;
   inset: 0;
   background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.75) 100%);
}

#wrapper .project-gallery__card-body {
   position: absolute;
   left: 0;
   right: 0;
   bottom: 0;
   padding: 16px 20px;
   color: #fff;
}

#wrapper .project-gallery__card--large .project-gallery__card-title {
   font-size: 28px;
}

#wrapper .project-gallery__card--small .project-gallery__card-title {
   font-size: 16px;
}

#wrapper .project-gallery__card-title {
   margin: 0 0 6px;
   font-weight: 700;
   text-transform: uppercase;
   line-height: 1.4;
   color: #fff;
}

#wrapper .project-gallery__card-address {
   margin: 0 0 12px;
   font-size: 18px;
   font-weight: 500;
   line-height: 1.5;
   color: #FFFFFF;
   display: -webkit-box;
   -webkit-line-clamp: 2;
   -webkit-box-orient: vertical;
   overflow: hidden;
}

#wrapper .project-gallery__card--small .project-gallery__card-address {
   font-size: 13px;
   margin-bottom: 8px;
}

#wrapper .project-gallery__card-meta {
   display: flex;
   flex-wrap: wrap;
   gap: 20px;
}

#wrapper .project-gallery__meta-item {
   display: flex;
   align-items: center;
   gap: 15px;
}

#wrapper .project-gallery__meta-icon {
   flex: 0 0 auto;
}

#wrapper .project-gallery__meta-text {
   display: flex;
   flex-direction: column;
   line-height: 1.3;
}

#wrapper .project-gallery__meta-label {
   font-size: 20px;
   line-height: 1.4;
   font-weight: 700;
   text-transform: uppercase;
   color: #FFFFFF;
}

#wrapper .project-gallery__meta-value {
   font-size: 14px;
   font-weight: 400;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
}

#wrapper .project-gallery__card--small .project-gallery__meta-label {
   font-size: 12px;
}

#wrapper .project-gallery__card--small .project-gallery__meta-value {
   font-size: 9px;
}

#wrapper .project-gallery__card--small svg {
   width: 16px;
   height: 16px;
}

/* Empty state */

#wrapper .project-gallery__empty {
   padding: 40px 0;
   text-align: center;
   color: #6b7280;
}

/* Pagination */

#wrapper .project-gallery__pagination {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   justify-content: center;
   gap: 8px;
   margin-top: 32px;
}

#wrapper .project-gallery__page-item .page-numbers {
   display: flex;
   align-items: center;
   justify-content: center;
   min-width: 40px;
   height: 40px;
   padding: 0 6px;
   border-radius: 8px;
   font-size: 15px;
   font-weight: 600;
   color: #16213e;
   text-decoration: none;
}

#wrapper .project-gallery__page-item .page-numbers.current {
   background-color: #A15200;
   color: #fff;
}

#wrapper .project-gallery__page-item .page-numbers.dots {
   color: #9ca3af;
}

#wrapper .project-gallery__page-item .page-numbers.prev,
#wrapper .project-gallery__page-item .page-numbers.next {
   color: #A15200;
   border-radius: 8px;
}

#wrapper .project-gallery__page-item .page-numbers:hover:not(.current):not(.dots) {
   background-color: #f3f4f6;
}

/* Tablet and up: restore the 1-large + 2-small side-by-side layout */
@media (min-width: 768px) {
   #wrapper .project-gallery__block {
      flex-direction: row;
   }

   #wrapper .project-gallery__block--reversed {
      flex-direction: row;
   }

   #wrapper .project-gallery__block--partial {
      flex-direction: row;
      flex-wrap: wrap;
   }

   #wrapper .project-gallery__block--partial .project-gallery__card {
      flex: 1 1 calc(33.333% - 11px);
   }

   #wrapper .project-gallery__block>.project-gallery__card--large {
      flex: 2 1 0;
   }

   #wrapper .project-gallery__stack {
      flex: 1 1 0;
   }

   #wrapper .project-gallery__card--small {
      min-height: 172px;
      flex: 1 1 0;
   }
}

@media (max-width: 768px) {
   #wrapper .project-gallery__card--large {
      min-height: 240px;
   }

   #wrapper .project-gallery__card--large .project-gallery__card-address {
      font-size: 13px;
      margin-bottom: 8px;
   }

   #wrapper .project-gallery__card--large .project-gallery__card-title {
      font-size: 16px;
   }

   #wrapper .project-gallery__card--large .project-gallery__meta-label {
      font-size: 12px;
   }

   #wrapper .project-gallery__card--large .project-gallery__meta-value {
      font-size: 9px;
   }

   #wrapper .project-gallery__card--large svg {
      width: 16px;
      height: 16px;
   }
}