/* Public catalogue pages: the page-per-URL (/p/...) and the category hubs
   (/explore). Colours come from the tokens in theme.css; the card grids reuse
   the landing's .tiles / .finds styles. */

.pg { padding-top: 8px; }

/* ---------- /p header: text on the left, screenshot on the right ---------- */
.pg-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.pg-main { min-width: 0; }

.pg-meta { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); min-width: 0; }
.pg-fav { width: 20px; height: 20px; border-radius: 5px; background: var(--hover); flex: none; }
.pg-fav.is-missing { visibility: hidden; }
.pg-host { color: var(--text-2); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-host:hover { color: var(--text); text-decoration: underline; }
.pg-type { color: var(--muted); text-decoration: none; }
.pg-type:hover { color: var(--text); text-decoration: underline; }
.dot { color: var(--muted); }

.pg-title { margin: 10px 0 8px; font-size: 32px; font-weight: 750; line-height: 1.15; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.pg-desc { margin: 0 0 14px; color: var(--text-2); font-size: 16px; line-height: 1.55; }

.pg-cats { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pg-cat {
    display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px;
    background: var(--hover); border: 1px solid var(--line); font-size: 13px; font-weight: 550;
    color: var(--text); text-decoration: none;
}
.pg-cat:hover { color: var(--text); border-color: var(--line-2); background: rgba(255, 255, 255, 0.12); }

/* The extension's bar, in the page: 👍 · Tonble · 👎, same proportions as the real one. */
.pg-bar { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; }
.pg-tonble { padding: 12px 40px; font-size: 17px; letter-spacing: 0.04em; }
.pg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.pg-actions .cta-ghost { font: inherit; font-size: 15px; font-weight: 600; background: transparent; cursor: pointer; }
.pg-edit { color: var(--link); text-decoration: none; }
.pg-edit:hover { text-decoration: underline; }
.pg-share { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 16px; font-size: 13px; }
button.pg-share-btn { font: inherit; font-size: 13px; cursor: pointer; }
.pg-share-label { color: var(--muted); margin-right: 4px; }
.pg-share-btn {
    padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04);
    color: var(--text-2); text-decoration: none; font-weight: 550;
}
.pg-share-btn:hover { color: var(--text); border-color: var(--line-2); background: var(--hover); }

.pg-signin { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }
.pg-signin a { color: var(--link); }
.pg-stats { font-size: 13.5px; color: var(--muted); }
.pg-stats b { color: var(--text-2); font-weight: 600; }
.rx {
    width: 42px; height: 42px; border-radius: 50%; border: none; flex: none;
    background: rgba(255, 255, 255, 0.06); font-size: 19px; cursor: pointer;
    transition: transform 0.1s, background 0.15s;
}
.rx:hover { transform: scale(1.08); }
.rx.like:hover, .rx.like.is-active { background: rgba(76, 217, 100, 0.2); box-shadow: inset 0 0 0 1px rgba(76, 217, 100, 0.45); }
.rx.dislike:hover, .rx.dislike.is-active { background: rgba(255, 69, 58, 0.2); box-shadow: inset 0 0 0 1px rgba(255, 69, 58, 0.45); }
.pg.is-saving .rx { opacity: 0.5; pointer-events: none; }
.pg.is-error .rx { outline: 1px solid var(--dislike); }

.pg-shot {
    display: block; aspect-ratio: 16 / 10; overflow: hidden;
    border-radius: var(--radius); border: 1px solid var(--line);
    background: linear-gradient(135deg, color-mix(in srgb, var(--tint, var(--viz-1)) 40%, transparent), rgba(255, 255, 255, 0.04) 80%), var(--card-solid);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    transition: transform 0.12s ease, border-color 0.12s ease;
}
.pg-shot:hover { transform: translateY(-2px); border-color: var(--line-2); }
.pg-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* ---------- tags ---------- */
.pg-tags { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pg-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); text-decoration: none; }
.pg-tag span { color: var(--muted); font-size: 11.5px; margin-left: 2px; }
a.pg-tag:hover { color: var(--text); border-color: var(--line-2); background: var(--hover); }

/* ---------- more like this ---------- */
.pg-related { margin-top: 40px; }
.pg-related .land-title, .pg-related .land-sub { text-align: left; }

/* ---------- /explore hubs ---------- */
.ex-head { margin: 4px 0 20px; }
.ex-head h1 { margin: 0 0 6px; font-size: 30px; font-weight: 750; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.ex-emoji { font-size: 30px; line-height: 1; }
.ex-head .land-sub { text-align: left; margin: 0; }
.ex-crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13.5px; color: var(--muted); }
.ex-crumbs a { color: var(--text-2); text-decoration: none; }
.ex-crumbs a:hover { color: var(--text); text-decoration: underline; }
.ex-tiles .tile { padding: 20px 16px 18px; }
.ex-tiles .tile-emoji { font-size: 30px; }
.ex-tiles .tile-name { font-size: 15.5px; }
.ex-section { margin-top: 32px; }
.ex-title { margin: 0 0 12px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.ex-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.ex-chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); font-size: 13px; font-weight: 550;
    color: var(--text-2); text-decoration: none; white-space: nowrap;
}
.ex-chip span:last-child { color: var(--muted); font-size: 12px; font-weight: 500; }
.ex-chip:hover { color: var(--text); border-color: var(--line-2); background: var(--hover); }
.ex-chip.is-active { color: #fff; background: var(--accent); border-color: transparent; box-shadow: 0 2px 8px var(--accent-shadow); }
.ex-chip.is-active span:last-child { color: rgba(255, 255, 255, 0.8); }

/* search form (explore index + /search) */
.ex-search { display: flex; gap: 8px; margin-top: 14px; max-width: 560px; }
.ex-search input {
    flex: 1; min-width: 0; padding: 10px 16px; border-radius: 999px;
    border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.05); color: var(--text);
    font: inherit; font-size: 15px;
}
.ex-search input::placeholder { color: var(--muted); }
.ex-search input:focus { outline: none; border-color: var(--c-pink); box-shadow: 0 0 0 3px var(--focus-ring); }
.ex-search button {
    padding: 10px 20px; border-radius: 999px; border: none;
    background: var(--accent); color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
    box-shadow: 0 2px 8px var(--accent-shadow);
}
.ex-sub { margin-top: 0; }
.ex-tonble { color: var(--link); text-decoration: none; font-weight: 600; }
.ex-tonble:hover { text-decoration: underline; }

/* curator editor (/p/.../edit) */
.edit-form { display: grid; gap: 16px; }
.edit-field { display: grid; gap: 6px; font-size: 14px; }
.edit-field > span, .edit-field > legend { color: var(--text-2); font-weight: 550; padding: 0; }
.edit-field fieldset, fieldset.edit-field { border: 0; margin: 0; padding: 0; }
.hint-inline { color: var(--muted); font-weight: 400; font-size: 12.5px; margin-left: 6px; }
.edit-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; }
.edit-check { grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; padding-bottom: 8px; }
.edit-check input { margin: 0; }
.edit-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 14px; }
.edit-cat { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); }
.edit-cat label { margin: 0; cursor: pointer; }
.edit-cat input { margin: 0; }
.edit-actions { display: flex; align-items: center; gap: 10px; }
.edit-actions .cta { border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.edit-note { padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.edit-note.is-ok { background: rgba(76, 217, 100, 0.12); color: #b7f5c0; }
.edit-note.is-error { background: rgba(255, 69, 58, 0.12); color: #ffb4ad; }
.edit-note.is-warn { background: rgba(255, 190, 11, 0.12); color: #ffe08a; }
.edit-note a { color: inherit; }
@media (max-width: 640px) { .edit-row { grid-template-columns: 1fr; } }
.ex-sub a { color: var(--link); }

/* tag cloud (/explore/tags): four size steps by use */
.ex-cloud { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ex-tag {
    display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 13px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); color: var(--text-2);
    text-decoration: none; font-size: 13px;
}
.ex-tag span { color: var(--muted); font-size: 11.5px; }
.ex-tag:hover { color: var(--text); border-color: var(--line-2); background: var(--hover); }
.ex-tag.s2 { font-size: 14.5px; }
.ex-tag.s3 { font-size: 16.5px; font-weight: 550; color: var(--text); }
.ex-tag.s4 { font-size: 19px; font-weight: 650; color: var(--text); border-color: var(--line-2); }

.pg-404-actions .cta-ghost { margin-left: 8px; }

.ex-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: 13.5px; }
.ex-pager a { color: var(--text-2); text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); }
.ex-pager a:hover { background: var(--hover); color: var(--text); }
.ex-pager .pg { color: var(--muted); padding: 0; }

/* ---------- not found ---------- */
.pg-404 { text-align: center; max-width: 520px; margin: 48px auto 0; }
.pg-404-mark { margin: 0; font-size: 48px; line-height: 1; }
.pg-404 h1 { margin: 14px 0 8px; font-size: 26px; font-weight: 750; letter-spacing: -0.02em; }
.pg-404 p { color: var(--text-2); }
.pg-404-actions { margin-top: 22px; }

@media (max-width: 820px) {
    .pg-grid { grid-template-columns: 1fr; gap: 18px; }
    .pg-shot { order: -1; }
    .pg-title { font-size: 26px; }
    .ex-head h1 { font-size: 26px; }
}
