/* Visual polish on top of the existing layout (loaded last in header.html).
   Layout is unchanged; this only softens the parts that looked rough:
   pagination, search bar, card hover, overlay badges, scrollbars, buttons. */

:root {
    --ps-accent: var(--pt-accent);
    --ps-surface: #ffffff;
    --ps-surface-2: #f4f4f5;
    --ps-border: rgba(0, 0, 0, .1);
    --ps-text: #18181b;
    --ps-muted: #71717a;
}
html.dark {
    --ps-surface: #2f2f2f;
    --ps-surface-2: #3a3a3a;
    --ps-border: rgba(255, 255, 255, .1);
    --ps-text: #f4f4f5;
    --ps-muted: #a1a1aa;
}

/* ---- Pagination: one soft pill group instead of white boxes in dark mode ---- */
.pagination { gap: .25rem; padding: .5rem 0; flex-wrap: wrap; justify-content: center; }
.pagination .page-item .page-link {
    border: 1px solid var(--ps-border);
    background: var(--ps-surface);
    color: var(--ps-text);
    border-radius: 999px !important;
    min-width: 2.5rem; height: 2.5rem; padding: 0 .9rem;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .95rem; box-shadow: none; margin: 0;
    transition: background .15s, color .15s, border-color .15s;
}
.pagination .page-item .page-link:hover { background: var(--ps-surface-2); border-color: var(--ps-accent); }
.pagination .page-item.active .page-link {
    /* !important: articleapp/base.css forces a grey active page. Selected = Ink, not amber (brand.css). */
    background: var(--pt-selected-bg) !important; border-color: var(--pt-selected-bg) !important; color: var(--pt-selected-fg) !important; font-weight: 700;
}
.pagination .page-item .page-link:focus { box-shadow: 0 0 0 3px rgba(255, 193, 7, .25); }
.pagination li.btn { border-radius: 999px; display: inline-flex; align-items: center; }

/* ---- Feed cards: gentle lift on hover, consistent corner radius ----
   (MagicGrid positions .outer_card with inline transforms, so only the
   media inside the card is animated.) */
.container .outer_card > a > img,
.container .outer_card > a > video {
    border-radius: 1.25rem !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .08);
    transition: box-shadow .2s ease, filter .2s ease, transform .2s ease;
    background: var(--ps-surface-2);
}
html.dark .container .outer_card > a > img,
html.dark .container .outer_card > a > video { box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .35); }
@media (hover: hover) {
    .container .outer_card:hover > a > img,
    .container .outer_card:hover > a > video { transform: translateY(-3px); filter: brightness(1.04); }
}

/* Overlay badges and buttons on cards: static/ptgrid.css ("card overlays"). */

/* ---- Search bar + write button under the feed ---- */
.ps-search { display: flex; justify-content: center; align-items: center; gap: .5rem; margin: 1.5rem auto .75rem; max-width: 34rem; padding: 0 1rem; }
.ps-search .ps-search-field { position: relative; flex: 1; }
.ps-search .ps-search-field .material-icons {
    position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--ps-muted); font-size: 1.25rem; pointer-events: none;
}
.ps-search input[type=text] {
    width: 100%; height: 2.75rem; padding: 0 1rem 0 2.6rem; border-radius: 999px;
    border: 1px solid var(--ps-border); background: var(--ps-surface); color: var(--ps-text);
    outline: none; transition: border-color .15s, box-shadow .15s;
}
.ps-search input[type=text]::placeholder { color: var(--ps-muted); }
.ps-search input[type=text]:focus { border-color: var(--ps-accent); box-shadow: 0 0 0 3px rgba(255, 193, 7, .2); }
.ps-pill-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
    height: 2.75rem; padding: 0 1.4rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
    border: 1px solid var(--ps-border); background: var(--ps-surface-2); color: var(--ps-text) !important;
    text-decoration: none !important; transition: background .15s, border-color .15s, transform .1s;
}
.ps-pill-btn:hover { border-color: var(--ps-accent); }
.ps-pill-btn:active { transform: scale(.98); }
.ps-pill-btn.is-primary { background: var(--ps-accent); border-color: var(--ps-accent); color: var(--pt-on-accent) !important; }
.ps-pill-btn .material-icons { font-size: 1.1rem; }
/* small BETA tag next to Studio links */
.ps-beta-tag {
    display: inline-block; margin-left: .35rem; padding: .05rem .38rem; border-radius: .35rem;
    font-size: .65rem; font-weight: 700; letter-spacing: .04em; line-height: 1.4; vertical-align: middle;
    background: var(--pt-ink); color: var(--pt-amber-500); /* same as the Studio BETA badge; red is for errors */
}

/* ---- Bootstrap bits that ignored dark mode ---- */
html.dark .form-control { background-color: var(--ps-surface); color: var(--ps-text); border-color: var(--ps-border); }
html.dark .form-control::placeholder { color: var(--ps-muted); }
html.dark .btn-dark { background-color: #3a3a3a; border-color: rgba(255, 255, 255, .12) !important; }
html.dark .btn-dark:hover { background-color: #474747; }

/* ---- Scrollbars: thin and theme-coloured (the sidebar one was a grey slab) ---- */
* { scrollbar-width: thin; scrollbar-color: rgba(127, 127, 127, .45) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(127, 127, 127, .4); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(127, 127, 127, .6); }

/* ---- Footer ---- */
footer a img.rounded-lg { border-radius: .75rem; }
footer h5 { letter-spacing: -.01em; }
