/* ===== GLOBALNE VARIJABLE ===== */
:root {
  --bg-dark: #121212;
  --bg-post: #1e1e1e;
  --text-light: #ffffff;
  --text-muted: #888;
  --accent-color: #ff6f61;
  --shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  --border-radius: 8px;
  --mobile-bp: 768px;
  --content-width: 800px;
  --transition-speed: 0.3s;
}

/* ===== GLAVNI STILOVI ===== */
body {
  background-color: var(--bg-dark);
  color: var(--text-light);
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Forum", serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  margin-top: 0;
}

h1 {
  font-size: clamp(1.5rem, 5vw, 1.75rem);
}

/* ===== LAYOUT ===== */
main {
  width: min(100% - 2rem, var(--content-width));
  margin: 1.25rem auto;
  padding: 1.25rem;
}

/* ===== BLOG LAYOUT ===== */
.blog-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  width: min(95%, 1200px);
  margin: 2rem auto;
  padding: 0 1rem;
}

.sidebar {
  /* position: sticky; */
  top: 120px;
  height: fit-content;
  background: var(--bg-sidebar);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

/* ===== BLOG POST ===== */
.blog-post {
  background-color: var(--bg-post);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: transform var(--transition-speed) ease;
}

.blog-post:hover {
  transform: translateY(-5px);
}

.blog-post h2 {
  color: var(--accent-color);
  margin-bottom: 0.625rem;
  font-size: clamp(1.25rem, 4vw, 1.5rem);
}

.post-thumbnail {
  width: 100%;
  max-width: 12.5rem;
  height: auto;
  border-radius: var(--border-radius);
  margin-bottom: 0.9375rem;
  object-fit: cover;
  aspect-ratio: 16/9;
}

.post-date {
  color: var(--text-muted);
  font-size: 0.9em;
  margin-bottom: 0.9375rem;
  display: block;
}

.read-more {
  display: inline-block;
  margin-top: 0.625rem;
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-speed) ease;
}

.read-more:hover {
  text-decoration: underline;
  color: #ff8a78;
}

/* ===== SEARCH STYLES ===== */
.search-container {
  margin-bottom: 2rem;
}

.search-box {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.search-box:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(255, 111, 97, 0.2);
}

#search-input {
  flex: 1;
  padding: 0.8rem 1.2rem;
  border: none;
  background: var(--bg-post);
  color: var(--text-light);
  font-size: 1rem;
  outline: none;
}

#search-input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  background: var(--accent-color);
  border: none;
  padding: 0 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.search-btn:hover {
  background: #ff8a78;
}

.search-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 60%;
  background: rgba(0, 0, 0, 0.1);
}

.search-btn svg {
  color: white;
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.search-btn:hover svg {
  transform: scale(1.1);
}

/* ===== TITLES SECTION ===== */
.titles-section {
  background: var(--bg-post);
  border-radius: 8px;
  padding: 1rem;
}

.titles-section h3 {
  color: var(--accent-color);
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1.1rem;
}

#titles-list {
  max-height: 500px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.title-item {
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  line-height: 1.4;
}

.title-item:hover {
  color: var(--accent-color);
  padding-left: 5px;
}

.title-item.active {
  color: var(--accent-color);
  font-weight: 600;
  border-left: 3px solid var(--accent-color);
  padding-left: 10px;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination-btn {
  background: var(--bg-sidebar);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover {
  background: var(--accent-color);
}

.pagination-btn:hover svg {
  stroke: white;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-sidebar);
}

.pagination-btn:disabled svg {
  stroke: var(--text-muted);
}

#page-info {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ===== RESPONZIVNOST ===== */
@media (max-width: 768px) {
  .blog-container {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .sidebar {
    position: static;
    background: transparent;
    box-shadow: none;
    padding: 1rem;
  }

  .titles-section {
    display: none;
  }

  .search-container {
    margin-bottom: 1rem;
  }

  .search-box {
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  #search-input {
    padding: 0.9rem 1.5rem;
  }

  .search-btn {
    padding: 0 1.5rem 0 1.2rem;
  }

  main {
    padding: 0 1rem;
  }

  .blog-post {
    padding: 0.9375rem;
  }

  .post-thumbnail {
    max-width: 9.375rem;
  }

  .post-date {
    font-size: 0.8em;
  }

  .read-more {
    font-size: 0.9em;
  }
}
