/*
 * Phoca Gallery 5 markup in the look of the Phoca Gallery 4 boxes of the Joomla 3 site.
 * There the look came from media/com_phocagallery/css/custom/default.css, which the Phoca Gallery 5
 * install replaced with an empty file; kept in the template so component updates cannot overwrite it.
 */

/* SVG icons: sizes from Phoca Gallery 5 theme_standard.css (no Phoca Gallery theme is enabled here) */
.ph-si {
  width: 1.5em;
  height: 1.5em;
  margin: 0 0.25em;
  fill: currentColor;
  vertical-align: middle;
}

/* Category (images) and categories views: boxes in rows */
#phocagallery .pg-category-items-box,
#phocagallery .pg-categories-items-box {
  display: grid;
  grid-template-columns: repeat(auto-fill, 230px);
  /* every box as tall as the tallest one, like jquery.equalheights on the old site */
  grid-auto-rows: 1fr;
}

#phocagallery .pg-item-box,
#phocagallery .pg-category-box {
  width: 200px;
  min-height: 240px;
  padding: 10px;
  margin: 5px;
  background: #fff;
  -webkit-box-shadow: 1px 1px 2px 1px rgba(120, 120, 120, 0.5), inset 0px 0px 7px 7px rgba(240, 240, 240, 0.2);
  box-shadow: 1px 1px 2px 1px rgba(120, 120, 120, 0.5), inset 0px 0px 7px 7px rgba(240, 240, 240, 0.2);
  -webkit-border-radius: 2px;
  border-radius: 2px;
}

#phocagallery .pg-item-box {
  margin-bottom: 18px;
}

#phocagallery .pg-item-box:hover,
#phocagallery .pg-category-box:hover {
  background: #fafafa;
}

/* Thumbnail centred in the 200x200 medium thumbnail area (pg-box1/2/3 in Phoca Gallery 4) */
#phocagallery .pg-item-box-image,
#phocagallery .pg-category-box-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
}

/* Image name (.pg-cv-name) */
#phocagallery .pg-item-box-info {
  margin-top: 5px;
  font-size: x-small;
  text-align: left;
}

#phocagallery .pg-item-box-title .ph-si {
  display: none;
}

#phocagallery .pg-item-box-title a {
  color: inherit;
}

/* Category name with the small folder icon (.pg-csv-name) */
#phocagallery .pg-category-box-title {
  margin-top: 5px;
  padding-left: 20px;
  text-align: left;
  background: url(../../../media/com_phocagallery/images/icon-folder-small.png) 0 1px no-repeat;
}

#phocagallery .pg-category-box-title .ph-si {
  display: none;
}

#phocagallery .pg-category-box-count {
  font-size: xx-small;
  color: #ccc;
}

/* {phocagallery view=categories} in articles: small thumbnail next to the category link,
   as the Phoca Gallery 4 plugin rendered it in a table row (cells with 1px padding) */
:not(#phocagallery) > .pg-categories-items-box .pg-category-box {
  display: flex;
  align-items: center;
}

:not(#phocagallery) > .pg-categories-items-box .pg-category-box-image {
  flex: none;
  padding: 1px;
}

:not(#phocagallery) > .pg-categories-items-box .pg-category-box-info {
  padding-left: 1px;
}

:not(#phocagallery) > .pg-categories-items-box .pg-category-box-title .ph-si {
  display: none;
}

:not(#phocagallery) > .pg-categories-items-box .pg-category-box-count {
  font-size: 11px;
}

/* Bootstrap 5 modal that Phoca Gallery 5 prints for its modal detail window (unused with PhotoSwipe):
   the template's Bootstrap 2 CSS leaves it as an invisible 316px block under the gallery */
#phocagallery .modal:not(.show) {
  display: none;
}

/* Spacing around the pagination as in Phoca Gallery 4 (div.ph-cb before the form, .pg-cv-paginaton) */
#phocagallery .pg-category-items-box {
  margin-bottom: 20px;
}

#phocagallery .pg-cv-paginaton {
  margin-bottom: 20px;
}

/* Categories view: Phoca Gallery 4 had a one-line div.pg-csv-paginaton after the pagination form */
#phocagallery.pg-csv > form + .ph-cb {
  height: 20px;
}
