/*
Theme Name: Benchtest
Author: LockerForge
Author URI: https://lockerforge.com
Description: A Gutenberg-native product-review magazine block theme.
Version: 1.0.3
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: benchtest
Tags: blog, one-column, two-columns, custom-colors, custom-menu, custom-logo, editor-style, featured-images, block-patterns, block-styles, wide-blocks
*/

:root {
    /* Base Colors */
    --benchtest-color-base: #FFFFFF;
    --benchtest-color-surface: #F2F2F2;
    --benchtest-color-text: #333333;
    --benchtest-color-muted: #777777;
    --benchtest-color-accent: #D32F2F;
    --benchtest-color-ticker-label: #111111;
    --benchtest-color-nav-band: #222222;

    /* Filter Pill Colors — deepened so WHITE pill text meets WCAG AA
       (4.5:1). Pill text is never black (owner's rule). */
    --benchtest-color-filter-tech: #0073AA;
    --benchtest-color-filter-home: #32823A;
    --benchtest-color-filter-kitchen: #8F6600;
    --benchtest-color-filter-gaming: #7865A6;

    /* Typography Scale */
    --benchtest-font-size-base: 16px;
    --benchtest-font-size-h1: 2.5rem;
    --benchtest-font-size-h2: 2rem;
    --benchtest-font-size-h3: 1.5rem;
    --benchtest-font-size-h4: 1.25rem;
    --benchtest-font-size-small: 0.875rem;
}
/* ------------------------------------------------------------------
   Header polish (1.0.2)
   ------------------------------------------------------------------ */

/* Account links read as quiet utility text, not red body links. */
.benchtest-account-links {
    margin: 0;
    white-space: nowrap;
}
.benchtest-account-links a {
    color: var(--benchtest-color-text);
    font-weight: 600;
    text-decoration: none;
}
.benchtest-account-links a:hover,
.benchtest-account-links a:focus-visible {
    color: var(--benchtest-color-accent);
    text-decoration: underline;
}

.benchtest-topbar__social.wp-block-social-links {
    gap: 4px 12px;
    flex-wrap: nowrap;
}

/* Icon-only header search: a clean square button, input opens on tap. */
.benchtest-header-search .wp-block-search__button {
    background: transparent;
    color: var(--benchtest-color-text);
    border: 1px solid #DDDDDD;
    border-radius: 4px;
    padding: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.benchtest-header-search .wp-block-search__button:hover,
.benchtest-header-search .wp-block-search__button:focus-visible {
    background: var(--benchtest-color-accent);
    border-color: var(--benchtest-color-accent);
    color: #FFFFFF;
}
.benchtest-header-search .wp-block-search__button svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}
.benchtest-navbar__inner {
    align-items: center;
}

/* Phone header: one tidy utility row, a compact masthead, and a
   full-width white menu bar (no dark side bands). */
@media (max-width: 600px) {
    .benchtest-topbar.wp-block-group {
        flex-wrap: nowrap;
        padding: 8px 16px !important;
    }
    .benchtest-topbar__date {
        display: none;
    }
    .benchtest-topbar__actions.wp-block-group {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
    }
    .benchtest-account-links {
        font-size: 13px !important;
    }
    /* Keep the five most-used networks on phones; the rest stay on desktop. */
    .benchtest-topbar .benchtest-topbar__social .wp-social-link-behance,
    .benchtest-topbar .benchtest-topbar__social .wp-social-link-linkedin,
    .benchtest-topbar .benchtest-topbar__social .wp-social-link-tumblr {
        display: none;
    }
    .benchtest-topbar__social.wp-block-social-links {
        gap: 0 10px;
        margin: 0;
    }

    .benchtest-masthead.wp-block-group {
        padding: 14px 16px !important;
    }
    .benchtest-masthead .wp-block-columns {
        gap: 8px;
        margin: 0;
    }
    .benchtest-masthead .wp-block-site-title {
        font-size: 1.75rem !important;
        line-height: 1.15;
    }
    .benchtest-masthead .benchtest-header-ad:empty,
    .benchtest-masthead .wp-block-column:has(.benchtest-header-ad:empty) {
        display: none;
    }

    .benchtest-navbar.wp-block-group {
        background: var(--benchtest-color-base) !important;
        border-top: 1px solid #E6E6E6;
        border-bottom: 1px solid #E6E6E6;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .benchtest-navbar > .benchtest-navbar__inner.wp-block-group {
        max-width: none;
        width: 100%;
        flex-wrap: nowrap;
        padding: 6px 16px !important;
    }
    .benchtest-navbar__inner .benchtest-header-search {
        min-width: 0;
        flex: 0 1 auto;
    }
    .benchtest-header-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__inside-wrapper {
        width: calc(100vw - 96px) !important;
        max-width: calc(100vw - 96px);
    }
    .benchtest-header-search .wp-block-search__input {
        min-width: 0;
    }
    .benchtest-navbar__inner .wp-block-navigation__responsive-container-open {
        width: 40px;
        height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: -8px;
    }
}

/* Imageless posts in lists get a designed tile, never a blank hole. */
.benchtest-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #2E2E2E 0%, #444444 100%);
    color: rgba(255, 255, 255, 0.55);
    box-sizing: border-box;
}
.benchtest-thumb-placeholder > a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: inherit;
}
.benchtest-thumb-placeholder svg {
    width: 45%;
    max-width: 64px;
    height: auto;
}
footer .benchtest-thumb-placeholder {
    background: linear-gradient(135deg, #3A3A3A 0%, #555555 100%);
}

/* ==================================================================
   Full polish (1.0.3)
   ================================================================== */

/* --- Page gutters on phones and tablets: content never touches the
       screen edge. Full-bleed bars (header bands, ticker, footer)
       keep their own padding. --- */
@media (max-width: 781px) {
    main.wp-block-group {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* --- Masthead: the site title stays on one line on desktop. --- */
@media (min-width: 782px) {
    .benchtest-masthead .wp-block-column:first-child {
        flex-basis: auto !important;
        flex-grow: 0;
        white-space: nowrap;
    }
}
.benchtest-masthead__title a {
    color: var(--benchtest-color-text);
    text-decoration: none;
}

/* --- Section titles (front page). --- */
.benchtest-section-title.wp-block-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 36px 0 20px;
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--benchtest-color-text);
}
.benchtest-section-title.wp-block-heading::before {
    content: "";
    flex: 0 0 4px;
    align-self: stretch;
    min-height: 1.1em;
    background: var(--benchtest-color-accent);
    border-radius: 2px;
}
.benchtest-section-title.wp-block-heading::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: #E3E3E3;
}
.benchtest-front > .benchtest-section-title:first-child {
    margin-top: 28px;
}

/* --- Category badges from post-terms: a tidy inline chip, never a
       full-width bar. --- */
.wp-block-post-terms.benchtest-term-badge {
    display: inline-block;
    width: auto;
    max-width: 100%;
    line-height: 1.4;
}
.wp-block-post-terms.benchtest-term-badge:not(.has-background) a {
    color: var(--benchtest-color-accent);
}
.wp-block-post-terms.benchtest-term-badge.has-background {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.75rem !important;
}

/* --- Breadcrumbs: no list bullet on the home link. --- */
.benchtest-breadcrumbs,
.benchtest-breadcrumbs li {
    list-style: none;
}
.benchtest-breadcrumbs .wp-block-home-link {
    list-style: none;
    margin: 0;
    padding: 0;
}
.benchtest-breadcrumbs p,
.benchtest-breadcrumbs .wp-block-post-title {
    margin: 0;
}
.benchtest-breadcrumbs .wp-block-post-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* --- Single post: hide empty boxes. --- */
.benchtest-tags-box:not(:has(.wp-block-post-terms)) {
    display: none;
}
.benchtest-author-box {
    align-items: center;
}
.benchtest-author-box .wp-block-post-author-biography:empty {
    display: none;
}
.benchtest-post-nav {
    flex-wrap: wrap;
    gap: 12px;
}

/* --- List thumbnails (sidebar, footer): fixed square, never squashed. --- */
.wp-block-post-template .is-nowrap > .wp-block-post-featured-image,
.wp-block-post-template .is-layout-flex > .wp-block-post-featured-image {
    flex-shrink: 0;
}
.wp-block-post-template .is-layout-flex > .wp-block-post-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.wp-block-post-template .is-layout-flex > .wp-block-group {
    min-width: 0;
}
.wp-block-post-template .is-layout-flex > .wp-block-group > .wp-block-post-title {
    margin-top: 0;
    line-height: 1.3;
}

/* --- Sidebar: tidy headings, hide the ad heading when no ad is set. --- */
.benchtest-sidebar-heading.wp-block-group {
    border-left: 4px solid var(--benchtest-color-accent);
    border-radius: 2px;
}
.benchtest-sidebar-heading .wp-block-heading {
    margin: 0;
    letter-spacing: 0.06em;
}
.benchtest-sidebar-ad:not(:has(.benchtest-ad-slot)) {
    display: none;
}

/* --- Search and listing results: compact media rows on wider screens. --- */
.benchtest-result .wp-block-post-featured-image {
    margin-bottom: 12px;
}
.benchtest-result .wp-block-post-title {
    line-height: 1.25;
}
.benchtest-result .wp-block-post-title a {
    color: var(--benchtest-color-text);
}
.benchtest-result .wp-block-post-title a:hover {
    color: var(--benchtest-color-accent);
}
@media (min-width: 600px) {
    .benchtest-result.wp-block-group {
        display: grid;
        grid-template-columns: 240px 1fr;
        column-gap: 24px;
        align-items: start;
    }
    .benchtest-result.wp-block-group > * {
        grid-column: 2;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: none !important;
    }
    .benchtest-result.wp-block-group > .wp-block-post-featured-image {
        grid-column: 1;
        grid-row: 1 / span 6;
        margin: 0 !important;
    }
    .benchtest-result.wp-block-group > .wp-block-post-terms {
        justify-self: start;
    }
}
.benchtest-result .wp-block-post-excerpt__excerpt {
    margin-top: 0;
    color: #555555;
}

/* --- Page search fields (search page, 404). --- */
.benchtest-page-search .wp-block-search__input {
    min-height: 46px;
    border: 1px solid #CCCCCC;
    border-radius: 4px;
    padding: 0 14px;
}
.benchtest-page-search .wp-block-search__button {
    min-height: 46px;
    margin-left: 8px;
    color: #FFFFFF;
}

/* --- Pagination (core query pagination). --- */
.benchtest-pagination {
    gap: 8px;
    margin-top: 24px;
}
.benchtest-pagination .page-numbers,
.benchtest-pagination a {
    font-weight: 600;
}

/* --- 404 --- */
.benchtest-404 {
    text-align: left;
}
.benchtest-404__code {
    margin: 0 0 4px;
    font-size: clamp(4.5rem, 18vw, 7.5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--benchtest-color-accent);
}
.benchtest-404 h1.wp-block-heading {
    font-size: clamp(1.75rem, 6vw, 2.5rem) !important;
}
.benchtest-404 .wp-block-home-link,
.benchtest-404__home {
    list-style: none;
    font-weight: 600;
}

/* --- Footer --- */
.benchtest-footer .has-muted-color,
.benchtest-footer-bar .has-muted-color {
    color: #AAAAAA !important;
}
.benchtest-footer .wp-block-heading {
    letter-spacing: 0.08em;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--benchtest-color-accent);
    display: inline-block;
}
.benchtest-footer__brand {
    margin: 0 0 12px;
}
.benchtest-footer__brand a {
    color: #FFFFFF;
    text-decoration: none;
}
.benchtest-footer__social.wp-block-social-links .wp-social-link {
    color: #BBBBBB !important;
}
.benchtest-footer__social.wp-block-social-links .wp-social-link:hover {
    color: #FFFFFF !important;
}
.benchtest-footer .wp-block-post-title a {
    color: #FFFFFF;
}
.benchtest-footer .wp-block-post-title a:hover {
    color: #FF8A80;
}
.benchtest-footer__rating {
    gap: 2px;
}
.benchtest-footer__rating .wp-block-post-date {
    margin: 0;
}
.benchtest-footer__links {
    list-style: none;
    margin: 0;
}
.benchtest-footer__links li {
    margin: 0 0 8px;
}
.benchtest-footer__links a:hover {
    color: #FFFFFF !important;
}
.benchtest-footer .wp-block-query .wp-block-post-template {
    gap: 0;
}

/* Footer bar: the menu sits on the dark bar, not in white boxes. */
.benchtest-footer-bar .wp-block-navigation,
.benchtest-footer-bar .wp-block-navigation .wp-block-navigation__container {
    background: transparent !important;
    color: #AAAAAA;
}
.benchtest-footer-bar .wp-block-navigation-item__content {
    color: #AAAAAA !important;
    background: transparent !important;
}
.benchtest-footer-bar .wp-block-navigation-item__content:hover {
    color: #FFFFFF !important;
}
.benchtest-footer-bar .wp-block-navigation__container {
    gap: 8px 18px;
}
@media (max-width: 781px) {
    .benchtest-footer-bar > .wp-block-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    .benchtest-footer-bar .wp-block-navigation .wp-block-navigation__container {
        justify-content: flex-start;
    }
    .benchtest-footer.wp-block-group,
    .benchtest-footer-bar.wp-block-group {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* --- 1.0.3 follow-ups --- */
.benchtest-post-meta p {
    margin: 0;
}
.benchtest-single-columns .wp-block-post-template .wp-block-post-title a,
.benchtest-single-columns .wp-block-query .wp-block-post-title a {
    color: var(--benchtest-color-text);
}
.benchtest-single-columns .wp-block-post-template .wp-block-post-title a:hover,
.benchtest-single-columns .wp-block-query .wp-block-post-title a:hover {
    color: var(--benchtest-color-accent);
}
.benchtest-footer .wp-block-heading + .benchtest-footer__links,
.benchtest-footer .wp-block-heading + .wp-block-list {
    margin-top: 16px;
}
.benchtest-footer__social.wp-block-social-links {
    gap: 6px 8px;
}
.benchtest-footer-heading-wrap + .benchtest-footer__links {
    margin-top: 16px;
}
@media (max-width: 599px) {
    .benchtest-post-meta {
        row-gap: 4px;
    }
    .benchtest-post-meta > .wp-block-post-author-name {
        flex-basis: 100%;
    }
    .benchtest-post-meta > .wp-block-post-author-name + p {
        display: none;
    }
}
/* Posts without an author: no stray separator, no empty author box. */
.benchtest-post-meta > p:first-child {
    display: none;
}
.benchtest-author-box:not(:has(.wp-block-post-author-name)) {
    display: none;
}
.benchtest-author-box .wp-block-post-author-name::before {
    content: "Written by";
    display: block;
    margin-bottom: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--benchtest-color-accent);
}
.wp-block-post-terms.benchtest-term-badge {
    width: fit-content !important;
    margin-left: 0 !important;
    margin-right: auto !important;
}
/* Desktop gutters: wide content never touches the window edge. */
@media (min-width: 782px) {
    main.wp-block-group {
        padding-left: 24px !important;
        padding-right: 24px !important;
    }
}
