/* =========================================================
   PHOTO PAGE (Scoped)
   Applies only when <main class="dccam-photo-page"> exists
   ========================================================= */

.dccam-photo-page { color: #000; }

/* ---------------------------
   TOP SEARCH BAR (1 row)
---------------------------- */
.dccam-photo-page .dccam-photo-topbar { padding: 18px 0 10px; }
.dccam-photo-page .dccam-photo-topbar .container {
  display: flex;
  justify-content: flex-end;
}

.dccam-photo-page form#basicForm.dccam-photo-form {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 0 !important;
  margin: 0;
}

.dccam-photo-page #t_seg {
  width: 220px !important;
  height: 40px !important;
  border: 1px solid #000 !important;
  border-radius: 0 !important;
  color: #000 !important;
}
.dccam-photo-page #t_cat {
  width: 160px !important;
  height: 40px !important;
  border: 1px solid #000 !important;
  border-left: 0 !important;
  border-radius: 0 !important;
  color: #000 !important;
}
.dccam-photo-page #t_word {
  width: 280px !important;
  height: 40px !important;
  border: 1px solid #000 !important;
  border-left: 0 !important;
  border-radius: 0 !important;
  color: #000 !important;
  padding: 0 10px;
  margin: 0 !important;
}
.dccam-photo-page #search {
  width: 190px !important;
  height: 40px !important;
  background: #0076ad !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
}
.dccam-photo-page #search:hover { filter: brightness(0.95); }

@media (max-width: 768px) {
  .dccam-photo-page .dccam-photo-topbar .container { justify-content: flex-start; }
  .dccam-photo-page form#basicForm.dccam-photo-form {
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100%;
  }
  .dccam-photo-page #t_seg,
  .dccam-photo-page #t_cat,
  .dccam-photo-page #t_word,
  .dccam-photo-page #search { width: 100% !important; }
  .dccam-photo-page #t_cat,
  .dccam-photo-page #t_word { border-left: 1px solid #000 !important; }
}

/* ---------------------------
   SIDEBAR
---------------------------- */
.dccam-photo-page .dccam-photo-layout { padding: 10px 0 30px; }

.dccam-photo-page .widget {
  padding: 0.5rem 0;
  margin: 0;
  border-top: 1px solid #BFBFBF;
}
.dccam-photo-page .row-border-bottom { border-bottom: 0; }

.dccam-photo-page a.result-name {
  color: #0076AD;
  text-decoration: none;
}
.dccam-photo-page a.result-name:hover {
  color: #000;
  text-decoration: underline;
}
.dccam-photo-page .result-count { float: right; margin-right: 10px; }

/* ---------------------------
   TOOLBAR (Sort/Show/Language + view buttons)
---------------------------- */
.dccam-photo-page .dccam-photo-toolbar {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 14px !important;
  flex-wrap: nowrap !important;
  padding: 10px 0 10px !important;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 12px;
}
.dccam-photo-page .dccam-photo-toolbar-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: nowrap !important;
}
.dccam-photo-page .dccam-photo-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dccam-photo-page .fs-small { font-size: 13px; }

.dccam-photo-page select.select {
  min-width: 110px !important;
  width: auto !important;
  height: 34px;
  border: 1px solid #d6d6d6;
  border-radius: 3px;
  padding: 4px 10px;
}

.dccam-photo-page .change-view-btn {
  width: 40px !important;
  height: 40px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  cursor: pointer;
}
.dccam-photo-page .active-view-btn {
  background: #0076ad !important;
  border-radius: 5px !important;
}
.dccam-photo-page .active-view-btn svg path { fill: #fff !important; }

@media (max-width: 768px) {
  .dccam-photo-page .dccam-photo-toolbar {
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }
  .dccam-photo-page .dccam-photo-toolbar-left { flex-wrap: wrap !important; }
}

/* =========================================================
   THUMB BASE (NO CROP) - Applies to both views
   We target BOTH:
   - .photo-thumb (if you use class)
   - inline background-image div (original markup)
   ========================================================= */
.dccam-photo-page .photo-thumb,
.dccam-photo-page #grid-main-parent .col-lg-4 div[style*="background-image"] {
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-color: #f2f2f2 !important;
}

/* ---------------------------
   GRID VIEW
---------------------------- */
.dccam-photo-page #grid-main-parent.gallery-cards-parent-grid-view {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 28px !important;
}
@media (max-width: 1200px) {
  .dccam-photo-page #grid-main-parent.gallery-cards-parent-grid-view {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 992px) {
  .dccam-photo-page #grid-main-parent.gallery-cards-parent-grid-view {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 576px) {
  .dccam-photo-page #grid-main-parent.gallery-cards-parent-grid-view {
    grid-template-columns: 1fr !important;
  }
}
@media (min-width: 1400px) {
  .dccam-photo-page #grid-main-parent.gallery-cards-parent-grid-view {
    grid-template-columns: repeat(5, 1fr) !important;
  }
}

.dccam-photo-page #grid-main-parent.gallery-cards-parent-grid-view .image-list-parent {
  padding: 16px;
  border: 1px solid #eee;
  border-radius: 14px;
  background: #f7f7f7;
}

/* Grid thumb: fill column, big, NO CROP */
.dccam-photo-page #grid-main-parent.gallery-cards-parent-grid-view .photo-thumb,
.dccam-photo-page #grid-main-parent.gallery-cards-parent-grid-view .col-lg-4 div[style*="background-image"] {
  width: 100% !important;
  aspect-ratio: 3 / 4 !important;
  height: auto !important;
  border-radius: 10px;
  margin: 0 0 14px 0 !important;
}

/* Grid text */
.dccam-photo-page #grid-main-parent.gallery-cards-parent-grid-view .col-lg-8 {
  padding: 0 !important;
  text-align: left;
}
.dccam-photo-page #grid-main-parent.gallery-cards-parent-grid-view p {
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.4;
}

/* ---------------------------
   LIST VIEW (match original)
---------------------------- */
.dccam-photo-page #grid-main-parent.gallery-cards-parent-list {
  display: block !important;
}

.dccam-photo-page #grid-main-parent.gallery-cards-parent-list .row-border-top1 {
  padding: 16px 0;
  border-bottom: 1px solid #e0e0e0;
  margin: 0;
}

/* no card look */
.dccam-photo-page #grid-main-parent.gallery-cards-parent-list .image-list-parent {
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  width: 100%;
}

/* image column */
.dccam-photo-page #grid-main-parent.gallery-cards-parent-list .col-lg-4 {
  width: 180px !important;
  flex: 0 0 180px;
  text-align: center;
}

/* list thumb: fixed 150x150 like original */
.dccam-photo-page #grid-main-parent.gallery-cards-parent-list .photo-thumb,
.dccam-photo-page #grid-main-parent.gallery-cards-parent-list .col-lg-4 div[style*="background-image"] {
  width: 150px !important;
  height: 150px !important;
  aspect-ratio: auto !important;
  border-radius: 4px;
  margin: 0 auto;
}

/* text column */
.dccam-photo-page #grid-main-parent.gallery-cards-parent-list .col-lg-8 {
  flex: 1;
  padding-left: 24px;
}
.dccam-photo-page #grid-main-parent.gallery-cards-parent-list p {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.4;
}

@media (max-width: 576px) {
  .dccam-photo-page #grid-main-parent.gallery-cards-parent-list .image-list-parent {
    flex-direction: column;
    align-items: flex-start;
  }
  .dccam-photo-page #grid-main-parent.gallery-cards-parent-list .col-lg-4 {
    width: 100% !important;
    flex: 0 0 auto;
    text-align: left;
    margin-bottom: 10px;
  }
  .dccam-photo-page #grid-main-parent.gallery-cards-parent-list .col-lg-8 {
    padding-left: 0;
    width: 100%;
  }
}

/* ---------------------------
   PAGINATION
---------------------------- */
.dccam-photo-page .pagination {
  margin: 10px auto;
  border-top: 1px solid #BFBFBF;
  padding: 10px 0;
}
.dccam-photo-page .page-link {
  border: none;
  color: #0076ad;
  font-weight: bold;
  background: transparent;
}
.dccam-photo-page .page-link:hover {
  text-decoration: underline;
  color: #000;
}

/* =========================================================
   FIX: GRID VIEW cards too tall + thumbnails too small
   Put this at the VERY BOTTOM of photo.css
   ========================================================= */

.dccam-photo-page #grid-main-parent.gallery-cards-parent-grid-view .image-list-parent{
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

/* Bootstrap columns are causing layout issues inside grid cards */
.dccam-photo-page #grid-main-parent.gallery-cards-parent-grid-view .image-list-parent .col-lg-4,
.dccam-photo-page #grid-main-parent.gallery-cards-parent-grid-view .image-list-parent .col-lg-8{
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 auto !important;
  padding: 0 !important;
}

/* Make the thumbnail area BIG (no crop) */
.dccam-photo-page #grid-main-parent.gallery-cards-parent-grid-view .photo-thumb,
.dccam-photo-page #grid-main-parent.gallery-cards-parent-grid-view .col-lg-4 div[style*="background-image"]{
  width: 100% !important;
  aspect-ratio: 3 / 4 !important;     /* portrait-friendly */
  height: auto !important;
  background-size: contain !important; /* DO NOT crop */
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-color: #f2f2f2 !important;
  border-radius: 12px !important;
  margin: 0 0 12px 0 !important;
}

/* Prevent super tall cards from long text */
.dccam-photo-page #grid-main-parent.gallery-cards-parent-grid-view .col-lg-8{
  text-align: left !important;
}

/* Limit text lines so cards stay same height */
.dccam-photo-page #grid-main-parent.gallery-cards-parent-grid-view .col-lg-8 p{
  margin: 6px 0 !important;
  line-height: 1.35 !important;
  max-height: none !important;
}

/* clamp long description/title if you have it */
.dccam-photo-page #grid-main-parent.gallery-cards-parent-grid-view .photo-title{
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* =========================================================
   PAGINATION – Bigger, clearer, easier to click
   ========================================================= */

.dccam-photo-page .pagination {
  margin: 24px auto 10px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px; /* space between numbers */
  flex-wrap: wrap;
}

/* Page links */
.dccam-photo-page .pagination .page-link,
.dccam-photo-page .pagination a {
  font-size: 15px;
  font-weight: 600;
  color: #0076ad;
  padding: 6px 12px;
  min-width: 36px;
  text-align: center;
  border-radius: 6px;
  text-decoration: none;
  line-height: 1.2;
}

/* Hover */
.dccam-photo-page .pagination a:hover {
  background: rgba(0, 118, 173, 0.1);
  text-decoration: none;
}

/* Current page */
.dccam-photo-page .pagination .active,
.dccam-photo-page .pagination .current {
  background: #0076ad;
  color: #fff !important;
  border-radius: 6px;
  padding: 6px 12px;
}

/* Next / Prev buttons */
.dccam-photo-page .pagination a[rel="next"],
.dccam-photo-page .pagination a[rel="prev"] {
  font-weight: 700;
  padding: 6px 14px;
}

/* Mobile: slightly larger tap area */
@media (max-width: 576px) {
  .dccam-photo-page .pagination {
    gap: 8px;
  }
  .dccam-photo-page .pagination .page-link,
  .dccam-photo-page .pagination a {
    padding: 8px 14px;
    font-size: 16px;
  }
}
