/* Resource list pages: shadowrocket / loon / quantumultx / surge / stash /
   rule / strule / sbrule / profile / troll */

main > h1,
body > h1 {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.page-intro {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 14px;
}

/* Sticky search ------------------------------------------------------- */

.search-bar {
    position: sticky;
    top: var(--bar-h);
    z-index: 5;
    margin: 20px -8px 8px;
    padding: 12px 8px;
    background: var(--glass);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
}

.search-bar input {
    display: block;
    width: 100%;
    max-width: 560px;
    min-height: 48px;
    padding: 12px 16px 12px 44px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius);
    background-color: var(--surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238e8e96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 15px center;
    box-shadow: var(--shadow-sm);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.search-bar input::placeholder {
    color: var(--muted);
    opacity: 1;
}

.search-bar input:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.search-bar input:focus {
    border-color: var(--focus);
    box-shadow: var(--shadow-sm), var(--ring);
}

/* Item grid ----------------------------------------------------------- */

.container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 10px;
    margin: 16px 0 40px;
}

.container > a {
    min-width: 0;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius);
}

.myButton {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 58px;
    height: 100%;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 450;
    line-height: 1.5;
    letter-spacing: -0.005em;
    text-align: left;
    overflow-wrap: anywhere;
    cursor: pointer;
    transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease), background-color 180ms var(--ease);
}

.myButton:hover,
.myButton:focus-visible {
    border-color: var(--border-strong);
    background: var(--surface-hover);
    box-shadow: var(--shadow-md);
    color: var(--text);
    transform: translateY(-1px);
}

.myButton:active {
    border-color: var(--border-strong);
    background: var(--surface-active);
    box-shadow: var(--shadow-sm);
    transform: translateY(0) scale(.99);
}

.myButton:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.container > a:focus-visible {
    outline-offset: 2px;
}

/* Keyboard focus on the wrapping link highlights its card */
.container > a:focus-visible .myButton {
    border-color: var(--border-strong);
    background: var(--surface-hover);
}

@media (hover: none) {
    .myButton:hover {
        box-shadow: var(--shadow-sm);
        transform: none;
    }
}

@media (max-width: 480px) {
    .container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .myButton {
        min-height: 54px;
        padding: 12px 14px;
        font-size: 13.5px;
    }

    .search-bar {
        margin-inline: -18px;
        padding-inline: 18px;
    }
}
