/* Community gallery (/gallery/) + share page (/gallery/<id>).
   Builds on account.css tokens (--tpa-accent, --tpa-card, --tpa-line). */

.tpg-hero { max-width: 640px; margin: 8px 0 28px; }
.tpg-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; margin-bottom: 8px; }
.tpg-hero p { color: rgba(255, 255, 255, 0.65); margin: 0; }

.tpg-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.tpg-sort { width: auto; min-width: 300px; }
.tpg-sort .tpa-tab { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.tpg-sort .bxs-star { color: var(--tpa-accent); }
@media (max-width: 600px) { .tpg-sort { min-width: 0; width: 100%; } .tpg-toolbar .tpa-search { width: 100%; } }

.tpg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.tpg-grid-compact { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.tpg-card {
    display: flex;
    flex-direction: column;
    background: var(--tpa-card);
    border: 1px solid var(--tpa-line);
    border-radius: 16px;
    overflow: hidden;
    color: #fff !important;
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s;
}
.tpg-card:hover { border-color: rgba(255, 143, 31, 0.4); transform: translateY(-2px); }
.tpg-card:focus-visible { outline: 2px solid var(--tpa-accent); outline-offset: 2px; }
.tpg-card-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #0a1428 0%, #22324f 60%, #3a2a25 100%);
    color: rgba(255, 255, 255, 0.35);
    font-size: 3rem;
    overflow: hidden;
}
.tpg-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.tpg-card:hover .tpg-card-thumb img { transform: scale(1.04); }
.tpg-card-files {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    background: rgba(10, 10, 10, 0.72);
    color: rgba(255, 255, 255, 0.85);
}
.tpg-featured {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #111;
    background: var(--tpa-accent);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.tpg-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.tpg-card-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpg-card-meta { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: rgba(255, 255, 255, 0.6); }
.tpg-card-author { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpg-card-stats { display: flex; gap: 10px; flex-shrink: 0; }
.tpg-liked { color: #ff6b81; }
.tpg-card-facts { font-size: 0.75rem; color: rgba(255, 255, 255, 0.45); }

/* ---- Share page ---- */
.tpg-view { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 28px; align-items: start; }
@media (max-width: 900px) { .tpg-view { grid-template-columns: 1fr; } }
.tpg-stage {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, #0a1428 0%, #22324f 55%, #c87a3e 85%, #3a2a25 100%);
    border: 1px solid var(--tpa-line);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tpg-stage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpg-model { width: 100%; height: 100%; --poster-color: transparent; background: transparent; }
.tpg-stage-empty { font-size: 5rem; color: rgba(255, 255, 255, 0.3); }
.tpg-stage-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(10, 10, 10, 0.6);
    pointer-events: none;
}
.tpg-info { background: var(--tpa-card); border: 1px solid var(--tpa-line); border-radius: 18px; padding: 22px; }
.tpg-title { font-size: 1.6rem; font-weight: 700; margin: 0 0 4px; overflow-wrap: anywhere; }
.tpg-byline { color: rgba(255, 255, 255, 0.6); font-size: 0.88rem; }
.tpg-byline strong { color: #fff; }
.tpg-facts { color: rgba(255, 255, 255, 0.5); font-size: 0.82rem; margin-top: 6px; }
.tpg-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.tpg-like.active { border-color: rgba(255, 107, 129, 0.6) !important; color: #ff6b81 !important; background: rgba(255, 107, 129, 0.08) !important; }
.tpg-views { color: rgba(255, 255, 255, 0.5); font-size: 0.85rem; }
.tpg-h2 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.5); margin: 24px 0 10px; }
.tpg-downloads { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.tpg-dl {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #fff !important;
    text-decoration: none;
}
.tpg-dl:hover { border-color: rgba(255, 143, 31, 0.5); background: rgba(255, 143, 31, 0.08); }
.tpg-dl .bx { font-size: 1.2rem; color: var(--tpa-accent); }
.tpg-dl strong { display: block; font-size: 0.85rem; }
.tpg-dl small { display: block; font-size: 0.72rem; color: rgba(255, 255, 255, 0.5); }
.tpg-share-panel { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--tpa-line); }
.tpg-report { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 22px; font-size: 0.78rem; color: rgba(255, 255, 255, 0.45); }
.tpg-report .btn-link { margin-left: auto; color: rgba(255, 255, 255, 0.5) !important; text-decoration: none; }
.tpg-report .btn-link:hover { color: var(--tpa-accent) !important; }
.tpg-owner-note {
    margin-bottom: 14px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.82rem;
    background: rgba(255, 143, 31, 0.08);
    border: 1px solid rgba(255, 143, 31, 0.25);
}

.tpg-printed {
    position: absolute; top: 10px; right: 10px; padding: 3px 9px; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700; color: #fff; background: rgba(10, 10, 10, 0.72);
    display: inline-flex; align-items: center; gap: 4px;
}
.tpg-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.tpg-photos a { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--tpa-line); aspect-ratio: 4 / 3; }
.tpg-photos img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.tpg-photos a:hover img { transform: scale(1.04); }
