/* Conchtown Hideaway — Phoca Gallery 6 theme
   Loaded after Phoca's own styles and scoped to Phoca selectors. */

/* Phoca foundational layout and accessibility rules. */
.com_phocagallery figure { margin: 0; padding: 0; }
.pg-hide,
.ph-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.pg-hide { display: none; }
.ph-cb { clear: both; }
.ph-right { float: right; }
.ph-left { float: left; }
.pg-detail-nav-box { margin: 1em 1em 2em; }
.pg-comment-btn {
  display: inline-block;
  min-width: 2em;
  margin: 1px;
  padding: 2px;
  border: 1px solid #d9d0bd;
  border-radius: 2px;
  color: #153c32;
  text-align: center;
  text-decoration: none;
}
.pg-comment-btn.pg-b { font-weight: 700; }
.pg-comment-btn.pg-i { font-style: italic; }
.pg-comment-btn.pg-u { text-decoration: underline; }
.pg-top-icons { float: right; }
.ph-pswp-video-wrapper,
.pg-ytb-full,
.pg-ytb-detail {
  position: relative;
  height: 0;
  padding-bottom: 56.25%;
}
.ph-pswp-video-wrapper iframe,
.pg-ytb-full iframe,
.pg-ytb-detail iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
@media only screen and (max-width: 500px) {
  #phocagallery-ucp.pg-ucp-view { font-size: 9px; }
}

#phocagallery,
.pg-category-view,
.pg-categories-view,
.pg-detail-view {
  --pg-conch-ink: #153c32;
  --pg-conch-palm: #17483b;
  --pg-conch-coral: #e46f52;
  --pg-conch-sand: #f3ecdc;
  --pg-conch-cream: #fffaf0;
  --pg-conch-line: #d9d0bd;
  color: var(--pg-conch-ink);
  font-family: "DM Sans", Arial, sans-serif;
}

/* Page heading and introductory copy */
#phocagallery h1,
#phocagallery h2,
#phocagallery h3,
.pg-category-view h1,
.pg-category-view h2,
.pg-categories-view h1,
.pg-categories-view h2 {
  color: var(--pg-conch-ink);
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  letter-spacing: -.035em;
}

#phocagallery h1,
.pg-category-view h1,
.pg-categories-view h1 {
  margin: 0 0 2.5rem;
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  line-height: 1;
}

/* Responsive image and category grids */
#phocagallery .pg-item-box-container,
#phocagallery .pg-category-box-container,
.pg-category-view .pg-item-box-container,
.pg-categories-view .pg-category-box-container {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.25rem 1.25rem;
  width: 100% !important;
}

#phocagallery .pg-item-box,
#phocagallery .pg-category-box,
.pg-category-view .pg-item-box,
.pg-categories-view .pg-category-box {
  position: relative;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Some Phoca layouts do not include the container wrapper. */
#phocagallery .pg-item-box,
.pg-category-view .pg-item-box {
  display: inline-block;
  vertical-align: top;
}

#phocagallery .pg-item-box-img,
#phocagallery .pg-category-box-image,
.pg-category-view .pg-item-box-img,
.pg-categories-view .pg-category-box-image {
  position: relative;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 0 !important;
  border-radius: 2px;
  background: var(--pg-conch-sand);
}

#phocagallery .pg-item-box-img img,
#phocagallery .pg-category-box-image img,
.pg-category-view .pg-item-box-img img,
.pg-categories-view .pg-category-box-image img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform .45s ease, filter .45s ease;
}

#phocagallery .pg-item-box:hover .pg-item-box-img img,
#phocagallery .pg-category-box:hover .pg-category-box-image img,
.pg-category-view .pg-item-box:hover .pg-item-box-img img,
.pg-categories-view .pg-category-box:hover .pg-category-box-image img {
  filter: saturate(1.05);
  transform: scale(1.035);
}

/* Titles, captions and descriptions */
#phocagallery .pg-item-box-title,
#phocagallery .pg-category-box-title,
.pg-category-view .pg-item-box-title,
.pg-categories-view .pg-category-box-title {
  min-height: 0 !important;
  margin: .8rem 0 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  color: var(--pg-conch-ink) !important;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: left !important;
  white-space: normal !important;
}

#phocagallery .pg-item-box-title a,
#phocagallery .pg-category-box-title a,
.pg-category-view .pg-item-box-title a,
.pg-categories-view .pg-category-box-title a {
  color: inherit !important;
  text-decoration: none !important;
}

#phocagallery .pg-item-box-desc,
#phocagallery .pg-category-box-description,
.pg-category-view .pg-item-box-desc,
.pg-categories-view .pg-category-box-description {
  margin-top: .35rem;
  color: #586b64;
  font-size: .82rem;
  line-height: 1.55;
  text-align: left;
}

/* Detail/action buttons */
#phocagallery .pg-item-box-button,
#phocagallery .pg-icon-detail,
#phocagallery .pg-icon-download,
.pg-category-view .pg-item-box-button,
.pg-category-view .pg-icon-detail,
.pg-category-view .pg-icon-download {
  border-color: transparent !important;
  background: var(--pg-conch-cream) !important;
  color: var(--pg-conch-palm) !important;
}

#phocagallery .btn,
.pg-category-view .btn,
.pg-categories-view .btn {
  border: 0;
  border-radius: 2px;
  background: var(--pg-conch-coral);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#phocagallery .btn:hover,
.pg-category-view .btn:hover,
.pg-categories-view .btn:hover {
  background: #ce5a3f;
  color: #fff;
}

/* Pagination and breadcrumbs */
#phocagallery .pagination,
.pg-category-view .pagination,
.pg-categories-view .pagination {
  display: flex;
  justify-content: center;
  gap: .35rem;
  margin: 3.5rem 0 1rem;
}

#phocagallery .page-link,
.pg-category-view .page-link,
.pg-categories-view .page-link {
  border: 1px solid var(--pg-conch-line);
  border-radius: 50%;
  background: transparent;
  color: var(--pg-conch-palm);
}

#phocagallery .active > .page-link,
.pg-category-view .active > .page-link,
.pg-categories-view .active > .page-link {
  border-color: var(--pg-conch-coral);
  background: var(--pg-conch-coral);
  color: #fff;
}

#phocagallery .pg-powered-by,
.pg-category-view .pg-powered-by,
.pg-categories-view .pg-powered-by {
  margin-top: 3rem;
  color: #7c8984;
  font-size: .65rem;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  #phocagallery .pg-item-box-container,
  #phocagallery .pg-category-box-container,
  .pg-category-view .pg-item-box-container,
  .pg-categories-view .pg-category-box-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  #phocagallery .pg-item-box-container,
  #phocagallery .pg-category-box-container,
  .pg-category-view .pg-item-box-container,
  .pg-categories-view .pg-category-box-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Compact thumbnail grid — final overrides */
#phocagallery .pg-item-box-container,
.pg-category-view .pg-item-box-container,
.com_phocagallery .pg-item-box-container,
#pg-msnr-container,
.pg-items-box,
.pg-category-items {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(160px, 220px)) !important;
  justify-content: center;
  align-items: start;
  gap: 1.5rem 1.25rem !important;
  width: 100% !important;
}

#phocagallery .pg-item-box,
.pg-category-view .pg-item-box,
.com_phocagallery .pg-item-box,
#pg-msnr-container .pg-item-box {
  float: none !important;
  width: 100% !important;
  max-width: 220px !important;
  min-width: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

#phocagallery .pg-item-box-img,
.pg-category-view .pg-item-box-img,
.com_phocagallery .pg-item-box-img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 4 / 3;
}

#phocagallery .pg-item-box-title,
.pg-category-view .pg-item-box-title,
.com_phocagallery .pg-item-box-title {
  margin-top: .55rem !important;
  font-size: 1rem !important;
  line-height: 1.2 !important;
}

#phocagallery .pg-item-box-desc,
.pg-category-view .pg-item-box-desc,
.com_phocagallery .pg-item-box-desc {
  margin-top: .2rem;
  font-size: .75rem;
  line-height: 1.4;
}

@media (max-width: 560px) {
  #phocagallery .pg-item-box-container,
  .pg-category-view .pg-item-box-container,
  .com_phocagallery .pg-item-box-container,
  #pg-msnr-container,
  .pg-items-box,
  .pg-category-items {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1.25rem .75rem !important;
  }

  #phocagallery .pg-item-box,
  .pg-category-view .pg-item-box,
  .com_phocagallery .pg-item-box,
  #pg-msnr-container .pg-item-box {
    max-width: none !important;
  }
}

@media (max-width: 360px) {
  #phocagallery .pg-item-box-container,
  .pg-category-view .pg-item-box-container,
  .com_phocagallery .pg-item-box-container,
  #pg-msnr-container,
  .pg-items-box,
  .pg-category-items {
    grid-template-columns: 1fr !important;
  }
}

/* Gallery-page cleanup: hide the component title and ordering control. */
.com_phocagallery .page-header,
.com_phocagallery > h1,
.com_phocagallery > h2,
#phocagallery > h1,
#phocagallery > h2,
.pg-category-view > h1,
.pg-category-view > h2,
.com_phocagallery .pg-category-view-title {
  display: none !important;
}

/* Keep unopened Bootstrap/Phoca dialogs out of normal document flow. */
.com_phocagallery .modal:not(.show),
#phocagallery .modal:not(.show),
.pg-category-view .modal:not(.show),
.com_phocagallery [role="dialog"][aria-hidden="true"],
#phocagallery [role="dialog"][aria-hidden="true"] {
  display: none !important;
}

/* Ordering and page-size toolbar. */
.com_phocagallery .pg-ordering,
.com_phocagallery .pg-ordering-select,
.com_phocagallery .pg-limitbox,
#phocagallery .pg-ordering,
#phocagallery .pg-ordering-select,
#phocagallery .pg-limitbox,
.com_phocagallery label:has(select),
#phocagallery label:has(select) {
  display: inline-flex !important;
  align-items: center;
  gap: .65rem;
  margin: 0 !important;
  color: #153c32;
  font: 500 .9rem "DM Sans", Arial, sans-serif;
  line-height: 1;
  white-space: nowrap;
}

.com_phocagallery form:has(select[name="limit"]),
#phocagallery form:has(select[name="limit"]),
.com_phocagallery .pg-pagination,
#phocagallery .pg-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .85rem 1.5rem;
}

/* Pagination count selector. */
.com_phocagallery .pagination select,
.com_phocagallery .pg-pagination select,
.com_phocagallery select[name="limit"],
#phocagallery .pagination select,
#phocagallery select[name="limit"] {
  width: auto !important;
  min-width: 5.5rem;
  height: 2.6rem;
  margin: 0 !important;
  padding: 0 2.25rem 0 .85rem;
  appearance: none;
  border: 1px solid #d9d0bd !important;
  border-radius: 2px !important;
  outline: 0;
  background-color: #fffaf0 !important;
  background-image: linear-gradient(45deg, transparent 50%, #17483b 50%), linear-gradient(135deg, #17483b 50%, transparent 50%) !important;
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50% !important;
  background-size: 5px 5px, 5px 5px !important;
  background-repeat: no-repeat !important;
  color: #153c32 !important;
  font: 600 .72rem "DM Sans", Arial, sans-serif !important;
  letter-spacing: .06em;
  text-transform: uppercase;
  box-shadow: none !important;
  cursor: pointer;
}

@media (max-width: 560px) {
  .com_phocagallery .pg-ordering,
  .com_phocagallery .pg-ordering-select,
  .com_phocagallery .pg-limitbox,
  #phocagallery .pg-ordering,
  #phocagallery .pg-ordering-select,
  #phocagallery .pg-limitbox,
  .com_phocagallery label:has(select),
  #phocagallery label:has(select) {
    width: 100%;
    justify-content: space-between;
  }

  .com_phocagallery select,
  #phocagallery select {
    max-width: 70%;
  }
}

.com_phocagallery .pagination select:hover,
.com_phocagallery .pg-pagination select:hover,
.com_phocagallery select[name="limit"]:hover,
#phocagallery .pagination select:hover,
#phocagallery select[name="limit"]:hover {
  border-color: #e46f52 !important;
}

.com_phocagallery .pagination select:focus,
.com_phocagallery .pg-pagination select:focus,
.com_phocagallery select[name="limit"]:focus,
#phocagallery .pagination select:focus,
#phocagallery select[name="limit"]:focus {
  border-color: #e46f52 !important;
  box-shadow: 0 0 0 3px rgba(228, 111, 82, .18) !important;
}

@media (prefers-reduced-motion: reduce) {
  #phocagallery img,
  .pg-category-view img,
  .pg-categories-view img {
    transition: none !important;
  }
}

/* Joomla 6/Phoca 6 wrapper fallback. */
.com_phocagallery .pg-item-box-container,
.com_phocagallery .pg-category-box-container {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.25rem 1.25rem;
  width: 100% !important;
}
.com_phocagallery :is(.pg-item-box, .pg-category-box) {
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.com_phocagallery :is(.pg-item-box-img, .pg-category-box-image) {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 0 !important;
  border-radius: 2px;
  background: #f3ecdc;
}
.com_phocagallery :is(.pg-item-box-img, .pg-category-box-image) img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
}
.com_phocagallery :is(.pg-item-box-title, .pg-category-box-title) {
  min-height: 0 !important;
  margin: .8rem 0 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  color: #153c32 !important;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: left !important;
  white-space: normal !important;
}
@media (max-width: 900px) {
  .com_phocagallery .pg-item-box-container,
  .com_phocagallery .pg-category-box-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .com_phocagallery .pg-item-box-container,
  .com_phocagallery .pg-category-box-container {
    grid-template-columns: 1fr;
  }
}
