/* Extracted block 1 from tag.html */
    /* Gallery Styles for Tag Page */
    .gallery {
      column-count: 4;
      column-gap: 10px;
      padding: 10px;
    }
    @media (max-width: 768px) {
      .gallery {
        column-count: 1;
      }
    }
    
    .meme {
      display: inline-block;
      width: 100%;
      margin-bottom: 10px;
      break-inside: avoid;
      position: relative;
      background-color: #eee; /* fallback background */
      min-height: 150px;      /* ensures container isn’t empty */
      border: 2px solid #000; /* 2px border for all memes */
      overflow: hidden;
    }
    .meme a {
      display: block;
      text-decoration: none;
      color: inherit;
    }
    /* Updated Media Styles */
    .meme img,
    .meme video {
      max-width: 100%;
      width: 100%;
      height: auto;
      object-fit: contain;
      display: block;
      transition: opacity 0.5s ease-in;
      opacity: 0;
    }
    .meme img.loaded,
    .meme video.loaded {
      opacity: 1;
    }
    #loader {
      text-align: center;
      padding: 20px;
    }
    /* Meme title overlay */
    .meme-title {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      background: rgba(0, 0, 0, 0.6);
      color: #fff;
      padding: 5px;
      text-align: center;
      z-index: 1;
    }
    .pager {
      display: flex; flex-wrap: wrap; gap: 6px;
      justify-content: center; align-items: center;
      margin: 26px auto 40px; padding: 0 10px;
      font-family: 'Nunito', Arial, sans-serif;
    }
    .pager a, .pager .current, .pager .gap {
      min-width: 38px; padding: 8px 12px;
      border-radius: 8px; text-align: center; text-decoration: none;
    }
    .pager a { background: #f2f2f2; color: #222; border: 1px solid #ddd; }
    .pager a:hover { background: #e2e2e2; text-decoration: none; }
    .pager .current { background: #000; color: #fff; font-weight: 800; }
    .pager .gap { color: #999; }

