/* ==========================================================================
   Phototranslatorai — blog listings
   Blog hero (search + category chips), featured card, grid/sidebar layout.
   Loaded on the posts page, archives and search results.
   ========================================================================== */

/* ------------------------------------------------------------ Blog hero --- */
.blog-hero { padding: 64px 0 36px; }
.blog-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }

/* Search field */
.search { position: relative; max-width: 520px; margin: 0 auto; }

.search .search-ic {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  color: var(--muted);
  pointer-events: none;
}

.search .search-field {
  width: 100%;
  height: 58px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0 18px 0 52px;
  font-size: 1rem;
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
}
.search .search-field:focus {
  outline: none;
  border-color: var(--p1);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--p1) 18%, transparent);
}
.search .search-field::-webkit-search-cancel-button { cursor: pointer; }

/* Category chips */
.cats {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}
.cat {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: border-color .2s, background .2s, color .2s;
}
.cat:hover { border-color: var(--p1); }
.cat.active {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}

/* --------------------------------------------------------- Featured card --- */
.featured {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 20px 0 56px;
  transition: transform .3s;
}
.featured:hover { transform: translateY(-4px); }
.featured:hover .emo { transform: scale(1.1) rotate(-4deg); }

.featured-media { display: block; height: 100%; }
.featured .thumb { min-height: 340px; height: 100%; }
.featured .thumb .emo { font-size: 5.5rem; }

.f-body {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  align-items: flex-start;
}
.f-title {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -.8px;
}
.f-title a:hover { color: var(--p1); }
.f-excerpt { color: var(--muted); margin-bottom: 8px; }

/* ----------------------------------------------------------- Grid layout --- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
  align-items: start;
}
.layout-main { min-width: 0; }

.grid-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.grid-title { font-size: 1.4rem; letter-spacing: -.5px; }
.grid-count { color: var(--muted); font-size: .9rem; font-weight: 600; }

/* Fades the grid while an AJAX filter request is in flight. */
.posts.is-loading {
  opacity: .45;
  pointer-events: none;
  transition: opacity .2s;
}

.no-res {
  text-align: center;
  padding: 50px 20px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.no-res .e { font-size: 2.6rem; display: block; margin-bottom: 8px; }

.load {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
}

/* ---------------------------------------------------------- Sidebar ------- */
.blog-sidebar {
  position: sticky;
  top: calc(var(--head) + 24px);
  display: grid;
  gap: 20px;
  align-content: start;
}
.blog-sidebar .ad-slot { margin: 0; }

/* ---------------------------------------------------------- Responsive ---- */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }

  .blog-sidebar {
    position: static;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  .featured { grid-template-columns: 1fr; }
  .featured .thumb { min-height: 220px; }
  .f-body { padding: 26px; }
}

@media (max-width: 640px) {
  .blog-hero { padding: 40px 0 24px; }

  /* Chips scroll horizontally instead of stacking into a tall block. */
  .cats {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-inline: -16px;
    padding-inline: 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .cats::-webkit-scrollbar { display: none; }
  .cat { flex-shrink: 0; }

  .blog-sidebar { grid-template-columns: 1fr; }
  .featured { border-radius: 22px; margin-bottom: 40px; }
  .load .btn { width: 100%; }
}
