#body {
  padding-top: 220px;
}

#pageContainer {
  width: 95%;
  max-width: 1800px;
  margin-inline: auto;
}

/* ===================== HERO BLOG POST ===================== */
.blog-hero {
  position: relative;
  width: 100%;
  height: 550px;
  border-radius: 25px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.4s ease;
}
.blog-hero:hover {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}
.blog-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}
.blog-hero {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: blog-skeleton-loading 1.5s infinite;
}
.blog-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.blog-hero img.loaded {
  opacity: 1;
}
.blog-hero:hover img {
  transform: scale(1.05);
}
.blog-hero-content {
  position: absolute;
  bottom: 40px;
  left: 40px;
  width: 50%;
  min-width: 450px;
  background-color: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2;
  transition:
    transform 0.4s ease,
    background-color 0.4s ease;
}
.blog-hero:hover .blog-hero-content {
  transform: translateY(-5px);
}
.blog-hero-content h2 {
  font-size: 2.8rem;
  max-width: 85%;
  color: #fff;
  margin: 5px 0;
  font-weight: 700;
  line-height: 1.25;
  transition: color 0.3s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}
.blog-hero:hover .blog-hero-content h2 {
  color: #d1b8e8;
}
.blog-hero-content p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}
.blog-hero-content .blog-meta span,
.blog-hero-content .blog-meta i,
.blog-hero-content .blog-meta svg {
  color: rgba(255, 255, 255, 0.75);
}
.blog-hero-content .blog-meta .read-time {
  color: #d1b8e8;
}

.blog-hero-content .category-badge {
  background-color: #865ba6;
  color: #fff;
  border: none;
  padding: 8px 18px;
}

/* ===================== LAYOUT & SIDEBAR ===================== */
.blog-layout {
  display: flex;
  gap: 40px;
  margin-top: 50px;
  margin-bottom: 80px;
  align-items: flex-start;
}
.blog-sidebar {
  width: 250px;
  flex-shrink: 0;
  background-color: transparent;
  padding: 0;
  position: sticky;
  top: 180px;
  align-self: flex-start;
  height: fit-content;
}
.blog-search {
  display: flex;
  align-items: center;
  background-color: #fff;
  border-radius: 50px;
  padding: 5px 5px 5px 20px;
  margin-bottom: 35px;
  border: 1px solid #e0e0e0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}
.blog-search:focus-within {
  border-color: #865ba6;
  box-shadow: 0 4px 15px rgba(134, 91, 166, 0.1);
}
.blog-search input {
  border: none;
  background: transparent;
  flex: 1;
  outline: none;
  font-size: 0.95rem;
  color: #333;
}
.blog-search button {
  background-color: #865ba6;
  color: #fff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50px;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background-color 0.3s ease;
}
.blog-search button:hover {
  background-color: #6d4985;
}
.blog-sidebar h3 {
  font-size: 1.4rem;
  color: #000;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 25px;
  position: relative;
  display: inline-block;
}
.blog-sidebar h3::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40px;
  height: 3px;
  background-color: #865ba6;
}
.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.category-list li {
  margin-bottom: 5px;
}
.category-list li:last-child {
  margin-bottom: 0;
}
.category-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background-color: transparent;
  color: #555;
  font-size: 1.05rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: all 0.3s ease;
}
.category-list li a::after {
  content: "\f105";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}
.category-list li a:hover,
.category-list li a.active {
  color: #865ba6;
  font-weight: 600;
  background-color: #fff; /* Vraćen background za aktivnu kategoriju */
  border: 1px solid #865ba6; /* Vraćen pun border za aktivnu */
  border-radius: 12px; /* Vraćen radius za aktivnu */
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(134, 91, 166, 0.08);
}
.category-list li a:hover::after,
.category-list li a.active::after {
  opacity: 1;
  transform: translateX(0);
}

/* ===================== KATEGORIJA BEDŽ ===================== */
.category-badge {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #865ba6;
  border: 1.5px solid #865ba6;
  padding: 6px 14px;
  border-radius: 50px;
  width: fit-content;
  display: inline-block;
  margin-bottom: 10px;
}

/* ===================== BLOG GRID & KARTICE ===================== */
.blog-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}
.blog-card {
  background-color: transparent;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  cursor: pointer;
  min-width: 0;
}
.blog-card:hover {
  transform: translateY(-5px);
}
.blog-card .card-image {
  width: 100%;
  height: 220px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: blog-skeleton-loading 1.5s infinite;
}
.blog-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: transform 0.5s ease;
}
.blog-card .card-image img.loaded {
  opacity: 1;
}
.blog-card:hover .card-image img {
  transform: scale(1.08);
}
.blog-card .card-content {
  padding: 20px 0 0 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.blog-card h4 {
  font-size: 1.45rem;
  color: #222;
  font-weight: 700;
  margin: 15px 0 10px 0;
  line-height: 1.3;
  transition: color 0.3s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}
.blog-card:hover h4 {
  color: #865ba6;
}
.blog-card p {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.5;
  margin: 0 0 25px 0;
  flex: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}
.blog-meta,
.card-meta {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}
.card-meta {
  padding-top: 15px;
  border-top: 1px solid #f0f0f0;
}
.blog-meta span,
.card-meta span {
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}
.card-meta .date {
  color: #888;
}
.card-meta .date::after,
.blog-meta .author::after {
  content: "•";
  display: inline-block;
  margin-left: 10px;
  color: #ccc;
}
.card-meta .read-time,
.blog-meta .read-time {
  color: #865ba6;
  font-weight: 600;
}
.blog-meta .author {
  color: #555;
}

/* ===================== PAGINACIJA ===================== */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 60px;
  width: 100%;
}
.blog-pagination a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 12px;
  background-color: #fff;
  color: #555;
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid #e8e8e8;
}
.blog-pagination a:hover {
  color: #865ba6;
  border-color: #865ba6;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(134, 91, 166, 0.1);
}
.blog-pagination a.active {
  background-color: #865ba6;
  color: #fff;
  border-color: #865ba6;
  box-shadow: 0 4px 15px rgba(134, 91, 166, 0.25);
}
.blog-pagination .page-arrow {
  color: #865ba6;
}

/* ===================== RESPONZIVNI DIZAJN ===================== */

/* Srednji desktop ekrani (1024px - 1440px) */
@media (max-width: 1440px) {
  .blog-hero {
    height: 450px;
  }
  .blog-hero-content h2 {
    font-size: 2.4rem;
    max-width: 95%;
  }
  .blog-grid {
    gap: 30px;
  }
  .blog-card h4 {
    font-size: 1.3rem;
  }
  .blog-card .card-image {
    height: 200px;
  }
}

/* Tableti i manji desktop ekrani (ispod 1024px) */
@media (max-width: 1023px) {
  #body {
    padding-top: 120px;
  }
  #pageContainer {
    width: 96%;
  }
  .blog-hero {
    height: 400px;
  }
  .blog-hero-content {
    width: 80%;
    min-width: unset;
    left: 30px;
    bottom: 30px;
  }
  .blog-hero-content h2 {
    font-size: 2rem;
    max-width: 100%;
  }

  /* Prebacivanje sidebara iznad grid-a */
  .blog-layout {
    flex-direction: column;
    gap: 30px;
    margin-top: 40px;
  }
  .blog-sidebar {
    width: 100%;
    position: relative;
    top: 0;
    display: flex;
    flex-direction: column;
    height: auto;
  }
  .blog-search {
    max-width: 400px;
    width: 100%;
    margin-bottom: 20px;
  }
  .blog-sidebar h3 {
    margin-bottom: 15px;
  }
  /* Horizontalna skrol lista za kategorije */
  .category-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 10px;
    gap: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .category-list::-webkit-scrollbar {
    display: none;
  }
  .category-list li {
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .category-list li a {
    padding: 8px 16px;
    font-size: 0.95rem;
  }
  .category-list li a::after {
    display: none;
  }
  .category-list li a:hover,
  .category-list li a.active {
    transform: none;
  }

  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Uklanjanje hover efekata za touch uređaje */
  .blog-hero:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  }
  .blog-hero:hover img,
  .blog-hero:hover .blog-hero-content,
  .blog-card:hover,
  .blog-card:hover .card-image img {
    transform: none;
  }
}

/* Veliki mobilni uređaji i manji tableti (ispod 767px) */
@media (max-width: 767px) {
  #body {
    padding-top: 0px;
  }
  .blog-hero {
    height: 320px;
    border-radius: 16px;
  }
  .blog-hero-content {
    width: 90%;
    left: 20px;
    bottom: 20px;
  }
  .blog-hero-content h2 {
    font-size: 1.6rem;
  }
  .blog-hero-content p {
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .blog-grid {
    gap: 20px;
  }
  .blog-card .card-image {
    height: 180px;
  }
  .blog-card h4 {
    font-size: 1.15rem;
  }
}

/* Mobilni uređaji (ispod 500px) */
@media (max-width: 499px) {
  #pageContainer {
    width: 95%;
    margin-inline: auto;
    padding-inline: 0;
    overflow-x: hidden;
  }
  .blog-hero {
    height: 340px;
    border-radius: 12px;
    margin-top: 10px;
  }
  .blog-hero-content {
    width: 95%;
    left: 15px;
    bottom: 15px;
    gap: 8px;
  }
  .blog-hero-content h2 {
    font-size: 1.35rem;
    line-height: 1.3;
  }
  .blog-hero-content p {
    font-size: 0.9rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
  .blog-hero-content .category-badge {
    padding: 5px 12px;
    font-size: 0.75rem;
  }
  .blog-hero-content .blog-meta span {
    font-size: 0.8rem;
  }
  .blog-sidebar h3 {
    font-size: 1.25rem;
  }
  .blog-search {
    max-width: 100%;
  }
  .blog-grid {
    grid-template-columns: minmax(0, 1fr); /* Prelazak u jednu kolonu na malim ekranima */
    gap: 40px;
  }
  .blog-card {
    background-color: transparent;
    border-radius: 16px;
    box-shadow: none;
    padding: 0;
  }
  .blog-card .card-image {
    height: 200px;
    border-radius: 12px;
  }
  .blog-card .card-content {
    padding: 15px 0 0 0;
  }
  .blog-card h4 {
    font-size: 1.25rem;
    margin: 10px 0 8px 0;
  }
  .blog-card p {
    font-size: 0.95rem;
    margin-bottom: 15px;
  }
  .blog-pagination {
    margin-top: 30px;
    margin-bottom: 20px;
    gap: 6px;
  }
  .blog-pagination a {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
    border-radius: 8px;
  }

  footer {
    display: none !important;
  }
  #mobileFooter {
    display: block !important;
    margin-top: 30px;
  }
}

@media (min-width: 500px) {
  #mobileFooter {
    display: none !important;
  }
}

/* ===================== SKELETON LOADERS ===================== */
.skeleton-box {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: blog-skeleton-loading 1.5s infinite;
  border-radius: 8px;
}

@keyframes blog-skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.hero-skeleton {
  width: 100%;
  height: 100%;
  border-radius: 25px;
}

.card-skeleton {
  display: flex;
  flex-direction: column;
  height: 420px;
  border-radius: 20px;
  background: transparent;
  overflow: hidden;
}
.card-skeleton .img-skel { width: 100%; height: 220px; border-radius: 20px; }
.card-skeleton .content-skel { padding: 20px 0 0 0; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card-skeleton .badge-skel { width: 90px; height: 28px; border-radius: 50px; }
.card-skeleton .title-skel { width: 95%; height: 22px; margin-top: 5px; }
.card-skeleton .text-skel { width: 100%; height: 15px; }
.card-skeleton .meta-skel { width: 60%; height: 15px; margin-top: auto; }
