/* Tags row: chips + overflow menu */
div.filters {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 22px;
    position: relative;

    nav {
        display: flex;
        gap: 10px;
        align-items: center;

        /* rail behavior */
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;

        /* make it feel tighter on mobile */
        padding: 2px 2px 8px;
        flex: 1 1 auto;

        /* subtle “fade” hint that it scrolls */
        mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 22px), transparent 100%);
        &::-webkit-scrollbar { height: 0 }
    }

    /* Chips: slightly smaller + calmer on mobile */
    .chip {
        display: inline-flex;
        flex: 0 0 auto;
        text-decoration: none;
        font-size: 0.82rem;
        font-weight: 600;
        color: var(--brand-charcoal);

        background: var(--bg-white);
        border: 1px solid var(--border-light);
        border-radius: 999px;
        padding: 9px 12px;

        transition: border-color 0.2s, box-shadow 0.2s;
        white-space: nowrap;

        &:hover { border-color: var(--primary-teal); box-shadow: 0 10px 22px var(--accent-glow); }
        &.active {
            border-color: var(--primary-teal);
            color: var(--primary-teal);
            box-shadow: 0 10px 22px var(--accent-glow);
        }
    }

    details {
      padding-right: 8px;
      padding-left: 8px;
      margin-left: 6px;
      border-left: 1px solid var(--border-light);

      summary {
        padding: 11px 16px;        /* ↑ larger tap target */
        font-size: 0.9rem;         /* ↑ slightly bigger text */
        font-weight: 600;

        background: transparent;
        border: 1.5px dashed var(--border-light); /* thicker border */
        border-radius: 999px;      /* still soft, but clearly a control */
        color: var(--text-slate);

        display: inline-flex;
        align-items: center;
        gap: 6px;

        &:hover {
          border-color: var(--primary-teal);
          color: var(--primary-teal);
          background: var(--bg-white);
          box-shadow: 0 10px 24px var(--accent-glow);
        }
      }

      &[open] summary {
        border-style: solid;
        border-color: var(--primary-teal);
        color: var(--primary-teal);
        background: var(--bg-white);
      }

      div[role="menu"] {
        position: absolute;
        right: 0;
        top: calc(100% + 8px);
        width: min(220px, 70vw);

        background: var(--bg-white);
        border: 1px solid var(--border-light);
        border-radius: 14px;
        box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
        padding: 8px;

        display: grid;
        gap: 2px;
        z-index: 2000;

        a {
          text-decoration: none;
          color: var(--brand-charcoal);
          font-weight: 600;
          font-size: 0.9rem;

          padding: 10px 10px;
          border-radius: 10px;
          
          &:hover {
            background: var(--bg-offwhite);
            color: var(--primary-teal);
          }
        }
      }
    }
}

/* Desktop: center the rail, keep “More” at end */
@media (min-width: 800px) {
    div.filters {
      margin: 16px 0 24px;
      nav {
        justify-content: center;
        mask-image: none; /* desktop doesn’t need the fade hint */
      }
    }
}