/* =========================================================
   blog.css — Travel Blog хуудас
   Бүтэц: гарчиг, ангиллын товчнууд, 1 том + 3 баганат карт, хуудаслалт
   ========================================================= */

/* ===== Hero: өргөн background зураг ===== */
.blog-hero {
  position: relative;
  display: flex; align-items: flex-end;
  min-height: clamp(240px, 30vw, 380px);
  padding: 48px 0 44px;
  overflow: hidden;
  color: #fff;
}
.blog-hero picture,
.blog-hero img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.blog-hero::after {
  content: "";
  position: absolute; inset: 0;
  /* Гар зурагтай цайвар зураг тул текстийн ард (зүүн доод) илүү бараан */
  background:
    linear-gradient(to right, rgba(12, 20, 16, 0.45), rgba(12, 20, 16, 0) 60%),
    linear-gradient(to bottom, rgba(12, 20, 16, 0) 25%, rgba(12, 20, 16, 0.6));
}
.blog-hero-text { position: relative; z-index: 1; }
.blog-hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}
.blog-hero p {
  margin-top: 6px;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

/* ===== Ангиллын товчнууд (pill) ===== */
.blog-list { padding: 32px 0 72px; }
.blog-tabs { scroll-margin-top: calc(var(--header-h) + 16px); }
.blog-tabs {
  display: flex; gap: 6px;
  padding: 6px;
  margin-bottom: 28px;
  border-radius: 999px;
  background: #f0f1ec;
  overflow-x: auto;
  scrollbar-width: none;
}
.blog-tabs::-webkit-scrollbar { display: none; }
.blog-tab {
  flex: 1 0 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border: 0; border-radius: 999px;
  background: none;
  font: inherit; font-size: 0.9rem; font-weight: 700;
  color: #4d5450;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.blog-tab svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.blog-tab:hover { color: var(--altai-forest); background: #fff; }
.blog-tab.is-active { background: var(--altai-forest); color: var(--ivory); }
.blog-tab:focus-visible { outline: 2px solid var(--sand-gold); outline-offset: 2px; }

/* ===== Картууд ===== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.post-card {
  position: relative;
  display: flex; flex-direction: column;
  border: 1px solid #e6e8df;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}
.post-card[hidden] { display: none; }
.post-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(31, 35, 35, 0.1); }
.post-link { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.post-link:focus-visible { outline: 3px solid var(--sand-gold); outline-offset: -3px; }
.post-card img {
  display: block;
  width: 100%; height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.post-body {
  display: flex; flex-direction: column; flex: 1;
  padding: 16px 18px 18px;
}
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.post-tag {
  padding: 3px 10px;
  border: 1px solid #d9dcd2;
  border-radius: 6px;
  font-size: 0.72rem; font-weight: 700;
  color: #4d5450;
}
.post-card h3 {
  flex: 1;
  font-size: 1.02rem; line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--charcoal);
}
.post-card:hover h3 { color: var(--altai-forest); }
.post-read {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px;
  font-size: 0.85rem; font-weight: 700;
  color: var(--altai-forest);
}
.post-read-icon {
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border: 1.5px solid var(--sand-gold);
  border-radius: 50%;
  font-size: 0.95rem; line-height: 1;
  color: var(--sand-gold);
  transition: background 0.2s, color 0.2s;
}
.post-card:hover .post-read-icon { background: var(--sand-gold); color: #fff; }

/* Эхний карт: 2 багана эзэлсэн том карт, зураг дээр текст (blog.js тэмдэглэнэ) */
.post-card.is-featured { grid-column: span 2; min-height: 340px; border: 0; }
.post-card.is-featured img {
  position: absolute; inset: 0;
  height: 100%; aspect-ratio: auto;
}
.post-card.is-featured::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(12, 20, 16, 0) 35%, rgba(12, 20, 16, 0.75));
}
.post-card.is-featured .post-body {
  position: relative; z-index: 1;
  justify-content: flex-end;
  padding: 26px 28px;
  color: #fff;
}
.post-card.is-featured .post-tag { border-color: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.9); color: var(--charcoal); }
.post-card.is-featured h3 {
  flex: none;
  max-width: 560px;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.post-card.is-featured:hover h3 { color: #fff; }
.post-card.is-featured .post-read { color: #fff; }
.post-card.is-featured .post-read-icon { border-color: #fff; color: #fff; }

.blog-empty { padding: 40px 0; text-align: center; color: #5d6460; }

/* ===== Хуудаслалт ===== */
.blog-pages {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 40px;
}
.blog-pages button {
  min-width: 38px; height: 38px;
  padding: 0 10px;
  border: 1px solid #d9dcd2;
  border-radius: 8px;
  background: #fff;
  font: inherit; font-size: 0.9rem; font-weight: 700;
  color: var(--charcoal);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.blog-pages button:hover:not(:disabled) { border-color: var(--altai-forest); color: var(--altai-forest); }
.blog-pages button.is-active { background: var(--altai-forest); border-color: var(--altai-forest); color: var(--ivory); }
.blog-pages button:disabled { opacity: 0.4; cursor: default; }

/* ===== Таблет ===== */
@media (max-width: 1024px) {
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-card.is-featured { grid-column: 1 / -1; }
}

/* ===== Гар утас ===== */
@media (max-width: 640px) {
  .blog-list { padding-top: 20px; }
  .blog-tabs { border-radius: 14px; margin: 0 -4px 20px; }
  .blog-tab { flex: none; padding: 9px 14px; }
  .blog-grid { grid-template-columns: 1fr; gap: 16px; }
  .post-card.is-featured { min-height: 300px; }
  .post-card.is-featured .post-body { padding: 20px; }
}
