/* =========================
   FILTERS
   ========================= */

   .filters{
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  
    padding: 0 1.2rem 14px 1.2rem;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 1rem auto;
  }
  
  .filter-btn{
    font-family: inherit;
    font-size: 0.7rem;
    line-height: 1;
    letter-spacing: 0.01em;
  
    background: #fff;
    color: #000;
  
    border: 1px solid rgba(0,0,0,0.22);
    padding: 5px 7px;
    border-radius: 0;
  
    cursor: pointer;
    white-space: nowrap;
  
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  }
  
  .filter-btn:hover{
    border-color: rgba(0,0,0,0.55);
  }
  
  .filter-btn.is-active{
    background: #000;
    color: #fff;
    border-color: #000;
  }
  
  /* =========================
     GRID LAYOUT
     ========================= */
  
  .grid{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  
    gap: 1.6rem;
    padding: 0.9rem;         /* 不贴边，也不厚 */
    max-width: 1240px;       /* 桌面更舒服，block 不会像被缩在中间 */
    margin: 0 auto;
  
    background: #fff;
  }
  
  /* Card */
  .grid-item{
    position: relative;
    cursor: pointer;
    overflow: visible;
    align-self: start;
  
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }
  
  /* Square media box */
  .grid-cover{
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: transparent;
  }
  
  /* Media inside cover box */
  .grid-cover img,
  .grid-cover video{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  
    transition: transform 0.22s ease;
  }
  
  /* Hover (克制，不像边框) */
  .grid-item:hover{
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  }
  
  .grid-item:hover .grid-cover img,
  .grid-item:hover .grid-cover video{
    transform: scale(1.012);
  }
  
  /* =========================
     HOVER INFO
     ========================= */
  
  .grid-info{
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
  
    padding: 0.6rem 0.8rem;
    background: rgba(255,255,255,0.92);
  
    opacity: 0;
    transition: opacity 0.18s ease;
    font-size: 0.9rem;
    line-height: 1.25;
  
    pointer-events: none;
  }
  
  .grid-item:hover .grid-info{
    opacity: 1;
  }
  
  .grid-info em{
    display: block;
    font-style: italic;
    color: #777;
    margin-top: 0.25rem;
  }
  
  /* =========================
     STATES
     ========================= */
  
  .grid-item.not-clickable{
    cursor: default;
  }
  
  .grid-item.not-clickable:hover{
    transform: none;
    box-shadow: none;
  }
  
  .grid-item.not-clickable:hover .grid-cover img,
  .grid-item.not-clickable:hover .grid-cover video{
    transform: none;
  }
  
  .grid-item.external::after{
    content: "↗";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 14px;
    opacity: 0.5;
  }
  
  /* video safety */
  .grid-cover video{
    max-width: 100%;
    max-height: 100%;
  }
  
  @media (max-width: 900px){
    .grid{
      grid-template-columns: 1fr;   /* ✅ mobile / tablet 一列 */
      gap: 1.2rem;
      padding: 0.85rem;
      max-width: 100%;
    }
  }
  
  @media (max-width: 560px){
    .filters{
      padding: 0 0.8rem 12px 0.8rem;
    }
  
    .grid{
      grid-template-columns: 1fr;   /* ✅ 再次确保一列，不会被覆盖 */
      gap: 0.9rem;
      padding: 0.7rem;
      max-width: 100%;
    }
  
    .grid-info{
      font-size: 0.85rem;
      padding: 0.55rem 0.7rem;
    }
  }
  