/* ==========================================================================
   Page hero — homepage + category pages
   --------------------------------------------------------------------------
   Replaces the centred "poster" header: a glowing 2.3rem H1 over an animated
   dot-scroll background, a 900px wall of SEO text, then a second panel with an
   H2 and a row of sort pills. Same content, re-cut as a command bar:

     [logo]  ● updated       ┃ 23        774          28
             H1              ┃ servers   votes/7d     online
             lede (3 lines, expandable)
     ─────────────────────────────────────────────────────
     RANKED BY  [Most Votes][Top Rated][Newest][Reviews]  · FILTER [New][Low]…

   Own class names (.ph-*) so the legacy .page-header-* / .btn-sort rules that
   sit inline in index.php and category.php cannot reach it.
   ========================================================================== */

.ph {
    --ph-line: rgba(0, 255, 255, 0.14);
    --ph-ink-2: #aab0bd;
    --ph-ink-3: #7c8594;
    position: relative;
    margin: 0 0 26px;
    background: rgba(10, 10, 15, 0.9);
    /* No cyan side bar: a 3px saturated edge next to the sidebar's own cyan
       read as one more neon stripe on an already busy left side. */
    border: 1px solid rgba(0, 255, 255, 0.16);
}

/* ---------- top: identity + stats ---------- */
.ph-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
}
/* No logo/icon tile: the game is already named in the H1 and shown in the
   sidebar, so the mark was decoration competing with the title. */
.ph-id { padding: 20px 22px 18px; min-width: 0; }
.ph-text { min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.ph-fresh {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-heading, 'Orbitron', sans-serif);
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #00ff9d;
}
.ph-fresh::before {
    content: "";
    width: 7px; height: 7px; border-radius: 50%;
    background: #00ff9d;
    box-shadow: 0 0 8px rgba(0, 255, 157, 0.7);
}

.ph-h1 {
    margin: 0;
    font-family: var(--font-heading, 'Orbitron', sans-serif);
    font-weight: 800;
    font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.9rem);
    line-height: 1.15;
    letter-spacing: .01em;
    color: #ffffff;
    text-wrap: balance;
}
.ph-h1 em {
    font-style: normal;
    color: var(--primary-color, #00ffff);
    text-shadow: 0 0 14px rgba(0, 255, 255, 0.35);
}

/* Lede: the full SEO paragraph stays in the DOM and starts visible; it is
   clamped to three lines with an expand control that needs no JS. */
.ph-more-toggle { display: none; }
.ph-lede {
    margin: 2px 0 0;
    max-width: 68ch;
    color: var(--ph-ink-2);
    font-size: .95rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ph-more {
    align-self: flex-start;
    margin-top: 2px;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--primary-color, #00ffff);
    cursor: pointer;
    user-select: none;
}
.ph-more::after { content: "Read more"; }
.ph-more:hover { text-decoration: underline; }
.ph-more-toggle:checked ~ .ph-lede { -webkit-line-clamp: unset; display: block; }
.ph-more-toggle:checked ~ .ph-more::after { content: "Show less"; }

/* Stat cells: 1px-divided grid in the same idiom as the Top Voted tiles */
.ph-stats {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(118px, auto);
    gap: 1px;
    background: var(--ph-line);
    border-left: 1px solid var(--ph-line);
}
.ph-stat {
    background: #0a0a0f;
    padding: 18px 20px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}
.ph-stat-n {
    font-family: var(--font-heading, 'Orbitron', sans-serif);
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.ph-stat-l {
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ph-ink-3);
    white-space: nowrap;
}

/* ---------- bottom: toolbar ---------- */
.ph-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 12px 22px;
    border-top: 1px solid var(--ph-line);
    background: rgba(0, 255, 255, 0.025);
}
.ph-bar-label {
    margin: 0;
    font-family: var(--font-heading, 'Orbitron', sans-serif);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ph-ink-3);
    white-space: nowrap;
}
.ph-seg { display: inline-flex; border: 1px solid rgba(0, 255, 255, 0.22); }
.ph-seg a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    color: var(--ph-ink-2);
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    border-right: 1px solid rgba(0, 255, 255, 0.14);
    transition: background .15s, color .15s;
}
.ph-seg a:last-child { border-right: 0; }
.ph-seg a i { font-size: .78rem; color: var(--primary-color, #00ffff); opacity: .75; }
.ph-seg a:hover { background: rgba(0, 255, 255, 0.07); color: #ffffff; }
/* Active = the same glass as the Vote button, so "selected" reads the same way everywhere */
.ph-seg a.is-active {
    background: linear-gradient(180deg, rgba(0, 255, 255, .22) 0%, rgba(0, 255, 255, .08) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
    color: #ffffff;
}
.ph-seg a.is-active i { opacity: 1; }
.ph-sep { width: 1px; height: 22px; background: var(--ph-line); }
.ph-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-chips a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 11px;
    border: 1px solid rgba(0, 255, 255, 0.22);
    color: var(--ph-ink-2);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .15s, color .15s, background .15s;
}
.ph-chips a i { font-size: .74rem; color: var(--primary-color, #00ffff); }
.ph-chips a:hover { border-color: var(--primary-color, #00ffff); color: #ffffff; background: rgba(0, 255, 255, 0.06); }
.ph-chips a.ph-guide { border-color: rgba(255, 0, 255, 0.35); }
.ph-chips a.ph-guide i { color: var(--secondary-color, #ff00ff); }
.ph-chips a.ph-guide:hover { border-color: var(--secondary-color, #ff00ff); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .ph-stats { grid-auto-columns: minmax(100px, auto); }
    .ph-stat { padding: 16px 14px 14px; }
    .ph-stat-n { font-size: 1.3rem; }
}
@media (max-width: 860px) {
    .ph-top { grid-template-columns: 1fr; }
    .ph-stats { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); grid-auto-columns: unset; border-left: 0; border-top: 1px solid var(--ph-line); }
    .ph-stat { align-items: center; text-align: center; padding: 12px 8px; }
}
@media (max-width: 560px) {
    .ph-id { padding: 16px 16px 14px; }
    .ph-bar { padding: 10px 12px; }
    .ph-seg { width: 100%; }
    .ph-seg a { flex: 1; justify-content: center; padding: 0 6px; font-size: .8rem; }
    .ph-seg a i { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ph-seg a, .ph-chips a { transition: none; }
}
