/**
 * RetroArcade content presentation layer (plugin v1.3.0)
 * Extends the homepage/nav design language (navy #0c1322, panel #121a30,
 * coral #e85d6a, teal #2ec4b6, amber #f0b429) to all content pages.
 *
 * Scope: everything except the homepage (body.home), which was designed
 * separately and must not shift. Buttons/blocks with their own styling
 * are left alone.
 */

:root {
    --ra-navy: #0c1322;
    --ra-panel: #121a30;
    --ra-coral: #e85d6a;
    --ra-teal: #2ec4b6;
    --ra-teal-ink: #0e7c72; /* link-contrast teal for white backgrounds */
    --ra-amber: #f0b429;
    --ra-ink: #1d2433;
    --ra-ink-soft: #2a3450;
    --ra-muted: #5b6474;
    --ra-line: #e5e8ef;
    --ra-label-bg: #f2f4f8;
}

/* ------------------------------------------------------------------ */
/* Byline removal (CSS fallback; PHP filter is primary)               */
/* ------------------------------------------------------------------ */
.ast-single-post .entry-meta,
.ast-article-single .entry-meta,
.entry-header .entry-meta {
    display: none;
}

/* ------------------------------------------------------------------ */
/* Body text rhythm                                                   */
/* ------------------------------------------------------------------ */
body:not(.home) .entry-content {
    color: var(--ra-ink);
}

body:not(.home) .entry-content > p,
body:not(.home) .entry-content > ul,
body:not(.home) .entry-content > ol {
    max-width: 42rem;
    line-height: 1.7;
    font-size: 1.05rem;
}

body:not(.home) .entry-content > p {
    margin-bottom: 1.4em;
}

/* Astra's block layout centers direct children at the content width;
 * headings must share the same 72ch axis as the body text or the
 * left edges drift apart. */
body:not(.home) .entry-content > h2,
body:not(.home) .entry-content > h3,
body:not(.home) .entry-content > h4,
body:not(.home) .entry-content > blockquote,
body:not(.home) .entry-content > pre {
    max-width: 42rem;
    width: 100%;
}

/* ------------------------------------------------------------------ */
/* Headings                                                           */
/* ------------------------------------------------------------------ */
body:not(.home) .entry-content h2 {
    color: var(--ra-navy);
    font-size: 1.65rem;
    letter-spacing: -0.015em;
    line-height: 1.25;
    margin: 2.1em auto 0.9em;
    padding-bottom: 0.5em;
    position: relative;
}

body:not(.home) .entry-content h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--ra-coral);
}

body:not(.home) .entry-content h3 {
    color: var(--ra-ink-soft);
    font-size: 1.28rem;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin: 1.8em auto 0.6em;
}

body:not(.home) .entry-content h4 {
    color: var(--ra-ink-soft);
    font-size: 1.08rem;
    margin: 1.5em auto 0.5em;
}

/* Headings inside cover blocks (hub heroes) keep their own colors */
body:not(.home) .entry-content .wp-block-cover h2,
body:not(.home) .entry-content .wp-block-cover h3 {
    color: inherit;
}

body:not(.home) .entry-content .wp-block-cover h2::after {
    display: none;
}

/* ------------------------------------------------------------------ */
/* Links in running content (teal; underline on hover only).          */
/* Buttons keep their block styling.                                  */
/* ------------------------------------------------------------------ */
body:not(.home) .entry-content a:not(.wp-block-button__link):not(.wp-element-button):not(.button) {
    color: var(--ra-teal-ink);
    text-decoration: none;
    transition: color 0.15s ease;
}

body:not(.home) .entry-content a:not(.wp-block-button__link):not(.wp-element-button):not(.button):hover {
    color: var(--ra-coral);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Links on dark cover blocks stay light */
body:not(.home) .entry-content .wp-block-cover a:not(.wp-block-button__link):not(.wp-element-button) {
    color: inherit;
}

/* ------------------------------------------------------------------ */
/* Tables — the Quick Facts infoboxes and comparison tables           */
/* border-collapse: separate + border-spacing 0 so border-radius +    */
/* overflow clipping work without wrapper markup.                     */
/* ------------------------------------------------------------------ */
body:not(.home) .entry-content table {
    width: 100%;
    max-width: 100%;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    margin: 1.6em 0 2.2em;
    font-size: 0.98rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(12, 19, 34, 0.08), 0 6px 18px rgba(12, 19, 34, 0.06);
}

body:not(.home) .entry-content .wp-block-table {
    margin: 1.6em 0 2.2em;
}

body:not(.home) .entry-content .wp-block-table table {
    margin: 0;
}

body:not(.home) .entry-content table td,
body:not(.home) .entry-content table th {
    border: 0;
    border-bottom: 1px solid var(--ra-line);
    padding: 12px 16px;
    text-align: left;
    vertical-align: top;
}

body:not(.home) .entry-content table tr:last-child td {
    border-bottom: 0;
}

/* First column reads as the label */
body:not(.home) .entry-content table td:first-child {
    background: var(--ra-label-bg);
    color: var(--ra-navy);
    font-weight: 600;
    width: 30%;
    min-width: 130px;
}

/* Dark navy header row when a table declares real headers */
body:not(.home) .entry-content table th,
body:not(.home) .entry-content table thead td {
    background: var(--ra-panel);
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-bottom: 0;
}

body:not(.home) .entry-content table th a {
    color: var(--ra-teal);
}

/* ------------------------------------------------------------------ */
/* Images & figures in content                                        */
/* ------------------------------------------------------------------ */
body:not(.home) .entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(12, 19, 34, 0.12);
}

/* Tiny inline images (icons, emoji fallbacks) shouldn't get card look */
body:not(.home) .entry-content img.emoji,
body:not(.home) .entry-content img[width][height][width="16"],
body:not(.home) .entry-content img[height="16"] {
    border-radius: 0;
    box-shadow: none;
}

body:not(.home) .entry-content figure {
    margin: 1.8em auto 2em;
}

body:not(.home) .entry-content figcaption {
    font-size: 0.85rem;
    color: var(--ra-muted);
    margin-top: 0.55em;
    line-height: 1.5;
}

/* ------------------------------------------------------------------ */
/* Lists                                                              */
/* ------------------------------------------------------------------ */
body:not(.home) .entry-content > ul,
body:not(.home) .entry-content > ol {
    padding-left: 1.4em;
    margin-bottom: 1.4em;
}

body:not(.home) .entry-content > ul li,
body:not(.home) .entry-content > ol li {
    margin-bottom: 0.45em;
}

body:not(.home) .entry-content > ul li::marker {
    color: var(--ra-coral);
}

body:not(.home) .entry-content > ol li::marker {
    color: var(--ra-teal-ink);
    font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Blockquotes                                                        */
/* ------------------------------------------------------------------ */
body:not(.home) .entry-content blockquote {
    border-left: 4px solid var(--ra-coral);
    background: #f8f9fc;
    color: var(--ra-ink-soft);
    margin: 1.6em auto;
    padding: 1em 1.3em;
    border-radius: 0 10px 10px 0;
    font-size: 1.02rem;
}

body:not(.home) .entry-content blockquote p:last-child {
    margin-bottom: 0;
}

body:not(.home) .entry-content blockquote cite {
    display: block;
    margin-top: 0.5em;
    font-size: 0.88rem;
    font-style: normal;
    color: var(--ra-muted);
}

/* ------------------------------------------------------------------ */
/* Code / kbd                                                         */
/* ------------------------------------------------------------------ */
body:not(.home) .entry-content code,
body:not(.home) .entry-content kbd {
    background: var(--ra-label-bg);
    color: var(--ra-navy);
    border: 1px solid var(--ra-line);
    border-radius: 5px;
    padding: 2px 7px;
    font-size: 0.9em;
}

body:not(.home) .entry-content pre {
    background: var(--ra-panel);
    color: #e8ecf5;
    border-radius: 10px;
    padding: 1.1em 1.3em;
    overflow-x: auto;
}

body:not(.home) .entry-content pre code {
    background: none;
    border: 0;
    color: inherit;
    padding: 0;
}

/* ------------------------------------------------------------------ */
/* Hero band on game/console/venue singles (markup from plugin PHP)   */
/* ------------------------------------------------------------------ */
.ract-hero {
    background: linear-gradient(135deg, var(--ra-navy) 0%, var(--ra-panel) 100%);
    border-radius: 14px;
    padding: 14px;
    margin: 0 0 2.2em;
    box-shadow: 0 6px 24px rgba(12, 19, 34, 0.18);
}

.ract-hero img {
    display: block;
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    border-radius: 10px;
    margin: 0;
    box-shadow: none;
}

.ract-hero-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 6px 2px;
}

.ract-hero-kicker {
    color: var(--ra-amber);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ract-hero-rule {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.16);
}

/* ------------------------------------------------------------------ */
/* Mobile: label column stacks on narrow screens.                     */
/* Only tables WITHOUT header cells (the label/value infoboxes)       */
/* stack; comparison tables keep grid + scroll if needed.             */
/* ------------------------------------------------------------------ */
@media (max-width: 640px) {
    body:not(.home) .entry-content table:not(:has(th)),
    body:not(.home) .entry-content table:not(:has(th)) tbody,
    body:not(.home) .entry-content table:not(:has(th)) tr,
    body:not(.home) .entry-content table:not(:has(th)) td {
        display: block;
        width: 100%;
    }

    body:not(.home) .entry-content table:not(:has(th)) td:first-child {
        width: 100%;
        border-bottom: 0;
        padding: 10px 16px 2px;
        font-size: 0.82rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }

    body:not(.home) .entry-content table:not(:has(th)) td:not(:first-child) {
        padding-top: 4px;
    }

    body:not(.home) .entry-content h2 {
        font-size: 1.4rem;
    }

    .ract-hero {
        padding: 10px;
        border-radius: 12px;
    }

    .ract-hero img {
        max-height: 240px;
    }
}
