/*
 * Components built into the theme in place of plugins:
 * slider, gallery, "Актуелно" widget, contact form and the 404 page.
 * The base design lives in custom.css.
 */

/* search icon (custom.css expects the Font Awesome 4 font) */
.searchform::after {
  margin-top: 2px;
  font-family: 'Font Awesome 5 Free';
  font-size: 13px;
  font-weight: 900;
}

/* the design uses the round Facebook logo */
.fa-facebook-f::before {
  content: "\f09a";
}

/* post card image: same 4:3 frame for every post, logo placeholder without an image */
.post-thumb {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background-color: #f4e9d1;
}

.post-thumb__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

.post-thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #6e2129;
  background-image: url('../images/soft-wallpaper.png');
}

.post-thumb__logo {
  width: 28%;
  max-width: 110px;
  opacity: .85;
}

@media (max-width: 992px) {
  .post-thumb {
    margin-bottom: 20px;
  }
}

/* "Актуелно" widget */
.rpwwt-widget ul {
  list-style: none;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

.rpwwt-widget ul li {
  overflow: hidden;
  margin: 0 0 1.5em;
}

.rpwwt-widget ul li:last-child {
  margin: 0;
}

.rpwwt-widget ul li img {
  display: inline;
  float: left;
  margin: .3em .75em .75em 0;
}

.rpwwt-widget ul li .rpwwt-placeholder {
  display: flex;
  float: left;
  align-items: center;
  justify-content: center;
  margin: 0 10px 0 0;
  background-color: #6e2129;
  background-image: url('../images/soft-wallpaper.png');
}

.rpwwt-widget ul li .rpwwt-placeholder img {
  float: none;
  width: 60%;
  height: auto;
  margin: 0 !important;
  opacity: .85;
}

/* slider */
.arhiv-slider:focus {
  outline: none;
}

.arhiv-slider__viewport {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2 / 1;
  touch-action: pan-y;
}

.arhiv-slider__slide {
  position: absolute;
  inset: 0;
  visibility: hidden;
}

.arhiv-slider__slide.is-active,
.arhiv-slider__slide.is-moving {
  visibility: visible;
}

.arhiv-slider__slide a {
  display: block;
  height: 100%;
}

.arhiv-slider__slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

.arhiv-slider__arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  padding: 0;
  border: 0;
  background: none;
  line-height: 0;
  cursor: pointer;
  transform: translateY(-50%);
  transition: opacity .4s;
}

.arhiv-slider__arrow--prev {
  left: 15px;
}

.arhiv-slider__arrow--next {
  right: 15px;
}

.arhiv-slider__arrow img {
  width: 32px;
  height: 32px;
}

.arhiv-slider__bullets {
  position: absolute;
  right: 0;
  bottom: 10px;
  left: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.arhiv-slider__bullet {
  width: 14px;
  height: 14px;
  margin: 4px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50px;
  background: #eee;
  cursor: pointer;
  transition: background-color .4s;
}

.arhiv-slider__bullet.is-active,
.arhiv-slider__bullet:hover,
.arhiv-slider__bullet:focus {
  background: #d5a738;
  outline: none;
}

@media (orientation: landscape) and (max-width: 900px), (orientation: portrait) and (max-width: 700px) {
  .arhiv-slider__arrow {
    display: none;
  }
}

/* galleries: [galerija] and the block editor gallery share one square grid */
.arhiv-galerija,
.content .wp-block-gallery.has-nested-images {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.content .wp-block-gallery.has-nested-images.columns-1 {
  grid-template-columns: minmax(0, 1fr);
}

.content .wp-block-gallery.has-nested-images.columns-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content .wp-block-gallery.has-nested-images.columns-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content .wp-block-gallery.has-nested-images.columns-5,
.content .wp-block-gallery.has-nested-images.columns-6,
.content .wp-block-gallery.has-nested-images.columns-7,
.content .wp-block-gallery.has-nested-images.columns-8 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.arhiv-galerija__item,
.content .wp-block-gallery.has-nested-images figure.wp-block-image {
  display: block !important;
  position: relative;
  width: auto !important;
  margin: 0 !important;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background-color: #f4e9d1;
  cursor: zoom-in;
}

.content .wp-block-gallery.has-nested-images figure.wp-block-image a {
  display: block;
  height: 100%;
}

.arhiv-galerija__item img,
.content .wp-block-gallery.has-nested-images figure.wp-block-image img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  object-fit: cover;
  border-radius: 0 !important;
  transition: transform .4s ease, filter .4s ease;
}

/* captions are shown in the lightbox, not over the tiles */
.content .wp-block-gallery.has-nested-images figure.wp-block-image::before,
.content .wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
  display: none !important;
}

.content .wp-block-gallery.has-nested-images > .blocks-gallery-caption {
  grid-column: 1 / -1;
  margin: 0;
}

.arhiv-galerija__item::after,
.content .wp-block-gallery.has-nested-images figure.wp-block-image::after {
  content: "\f00e";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  background-color: #6e2129;
  background-image: url('../images/soft-wallpaper.png');
  color: #fff;
  font-family: 'Font Awesome 5 Free';
  font-size: 15px;
  font-weight: 900;
  line-height: 40px;
  text-align: center;
  opacity: 0;
  transform: scale(.8);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}

.arhiv-galerija__item:hover img,
.arhiv-galerija__item:focus-visible img,
.content .wp-block-gallery.has-nested-images figure.wp-block-image:hover img,
.content .wp-block-gallery.has-nested-images figure.wp-block-image:focus-visible img {
  filter: brightness(.85);
  transform: scale(1.05);
}

.arhiv-galerija__item:hover::after,
.arhiv-galerija__item:focus-visible::after,
.content .wp-block-gallery.has-nested-images figure.wp-block-image:hover::after,
.content .wp-block-gallery.has-nested-images figure.wp-block-image:focus-visible::after {
  opacity: 1;
  transform: scale(1);
}

.arhiv-galerija__item:focus-visible,
.content .wp-block-gallery.has-nested-images figure.wp-block-image:focus-visible {
  outline: 2px solid #6e2129;
  outline-offset: 2px;
}

@media (max-width: 576px) {
  .arhiv-galerija,
  .content .wp-block-gallery.has-nested-images:not(.columns-1) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
}

/* PhotoSwipe lightbox */
.pswp {
  --pswp-bg: #120b0c;
  font-family: 'MyriadRegular', sans-serif;
}

.pswp__caption {
  position: absolute;
  bottom: 16px;
  left: 50%;
  max-width: min(90%, 800px);
  padding: 8px 14px;
  border-radius: 3px;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
}

.pswp__caption[hidden] {
  display: none;
}

/* contact form */
.wpcf7-form-control-wrap {
  position: relative;
}

.wpcf7-not-valid-tip {
  display: block;
  color: #dc3232;
  font-size: 1em;
  font-weight: normal;
}

.wpcf7 form .wpcf7-response-output {
  margin: 2em .5em 1em;
  padding: .2em 1em;
  border: 2px solid #00a0d2;
}

.wpcf7 form.init .wpcf7-response-output {
  display: none;
}

.wpcf7 form.sent .wpcf7-response-output {
  border-color: #46b450;
}

.wpcf7 form.failed .wpcf7-response-output {
  border-color: #dc3232;
}

.wpcf7 form.spam .wpcf7-response-output {
  border-color: #f56e28;
}

.wpcf7 form.invalid .wpcf7-response-output {
  border-color: #ffb900;
}

.arhiv-hp {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* 404 */
.error-404 {
  padding: 60px 0;
}

.error-404 .container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.error-404 .page-content {
  margin-top: 16px;
}

.error-404__home {
  margin-top: 20px;
}
