/* ===== Pratite nas na drustvenim mrezama (pocetna) ===== */

.row-social {
  background: #fff;
  padding: 30px 0 45px;
}

.social-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.social-head .page-heading {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.social-profiles {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Globalno .option4 a:hover boji linkove plavo, ovde vazi isto sto i za search dugme */
.row-social a.btn-orange,
.social-modal a.btn-orange,
.row-social a.btn-orange:hover,
.social-modal a.btn-orange:hover,
.row-social a.btn-orange:focus,
.social-modal a.btn-orange:focus,
.row-social a.btn-orange:active,
.social-modal a.btn-orange:active {
  color: #fff;
}

.row-social a.btn-orange:hover,
.social-modal a.btn-orange:hover,
.row-social a.btn-orange:active,
.social-modal a.btn-orange:active {
  background-color: #e6731a;
}

.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.social-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  padding: 0;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #f2f2f2;
  cursor: pointer;
}

.social-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .18);
  opacity: 0;
  transition: opacity .2s ease;
}

.social-tile:hover::after,
.social-tile:focus-visible::after {
  opacity: 1;
}

.social-tile:focus-visible {
  outline: 3px solid #f58220;
  outline-offset: 2px;
}

/* Tablet i telefon: horizontalni scroll umesto smanjivanja slika */
@media (max-width: 767.98px) {
  .social-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }

  .social-tile {
    flex: 0 0 42%;
    scroll-snap-align: start;
  }
}

/* Telefon: jedna velika slika u sredini, sledeca malo viri sa strane */
@media (max-width: 575.98px) {
  .social-grid {
    gap: 12px;
    scroll-snap-type: x mandatory;
  }

  .social-tile {
    flex: 0 0 85%;
    scroll-snap-align: center;
    border-radius: 6px;
  }

  .social-tile:only-child {
    flex-basis: 100%;
  }

  .social-head {
    flex-wrap: wrap;
  }

  .social-head .page-heading {
    flex-basis: 100%;
    height: auto;
    line-height: 1.4;
  }

  .social-head .page-heading span.page-heading-title {
    position: static;
    display: inline-block;
    padding-bottom: 8px;
  }
}

/* ===== Modal objave ===== */

.social-modal {
  /* visina ekrana - margine modala (2 x 1.75rem) - padding sadrzaja (2 x 24px) */
  --social-modal-h: calc(100vh - 3.5rem - 48px);
}

.social-modal .modal-dialog {
  max-width: 960px;
}

.social-modal .modal-content {
  position: relative;
  border: 0;
  border-radius: 6px;
  padding: 24px;
}

.social-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f1f1f1;
  color: #333;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease;
}

.social-modal-close:hover {
  background: #e2e2e2;
}

.social-modal-close:focus-visible {
  outline: 3px solid #f58220;
  outline-offset: 2px;
}

.social-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.social-modal-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: var(--social-modal-h);
  object-fit: contain;
  border-radius: 4px;
}

/* Naslov gore i dugmad dole su uvek vidljivi, skroluje samo opis */
.social-modal-text {
  display: flex;
  flex-direction: column;
  max-height: var(--social-modal-h);
  min-height: 0;
}

.social-modal-title {
  flex-shrink: 0;
  margin: 0 0 14px;
  padding-right: 48px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: #111;
}

.social-modal-caption {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 12px;
  white-space: pre-line;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.6;
  color: #333;
  scrollbar-width: thin;
  scrollbar-color: #cfcfcf transparent;
}

.social-modal-caption::-webkit-scrollbar {
  width: 6px;
}

.social-modal-caption::-webkit-scrollbar-thumb {
  background: #cfcfcf;
  border-radius: 3px;
}

.social-modal-caption::-webkit-scrollbar-track {
  background: transparent;
}

.social-modal-date {
  flex-shrink: 0;
  margin-top: 14px;
  font-size: 14px;
  color: #888;
}

.social-modal-links {
  flex-shrink: 0;
}

.social-modal-links hr {
  margin: 18px 0 14px;
}

.social-modal-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}


/* Telefon: slika iznad teksta, skroluje ceo modal */
@media (max-width: 767.98px) {
  .social-modal .modal-content {
    padding: 16px;
  }

  .social-modal-body {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .social-modal-image img,
  .social-modal-text {
    max-height: none;
  }

  .social-modal-caption {
    overflow: visible;
    padding-right: 0;
  }

  .social-modal-title {
    padding-right: 0;
  }

  .social-modal-close {
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
  }
}
