/* ============================================
   WordPress-specific overrides & theme extras
   ============================================ */

/* Body layout shell */
body { display: flex; flex-direction: column; min-height: 100vh; }
#page { flex: 1; display: flex; flex-direction: column; }
#content { flex: 1; }

/* ============================================
   Breadcrumb — Yoast SEO output styling
   ============================================ */

/* Yoast outputs: <span id="breadcrumbs"><span>...</span></span> */
.breadcrumb #breadcrumbs,
.breadcrumb #breadcrumbs > span {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.breadcrumb .breadcrumb-separator {
    color: var(--color-border-strong);
    margin: 0;
}

.breadcrumb .breadcrumb_last {
    color: var(--color-text-subtle);
}

/* ============================================
   Header navigation — native wp_nav_menu output
   ============================================ */

.site-nav .menu,
.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.site-nav .menu li { position: relative; }

.site-nav .menu li a {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: var(--r-md);
    font-size: 15px;
    font-weight: var(--fw-semibold);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all 120ms var(--ease-out);
    letter-spacing: -0.005em;
    white-space: nowrap;
}

.site-nav .menu li a:hover {
    color: var(--color-text);
    background: var(--color-surface-2);
}

.site-nav .menu li.current-menu-item > a,
.site-nav .menu li.current_page_item > a,
.site-nav .menu li.current-menu-ancestor > a,
.site-nav .menu li.current-post-ancestor > a {
    color: var(--color-text);
    background: var(--color-surface-2);
}

/* Hide sub-menus (dropdowns not in this design) */
.site-nav .menu ul { display: none; }

/* ============================================
   Footer navigation — native wp_nav_menu output
   ============================================ */

.footer-nav .menu,
.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--sp-4) var(--sp-5);
}

.footer-nav .menu > li,
.footer-nav ul > li {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-5);
}

.footer-nav .menu > li + li::before,
.footer-nav ul > li + li::before {
    content: "";
    width: 1px;
    height: 14px;
    background: var(--color-border-strong);
    display: inline-block;
}

.footer-nav .menu li a,
.footer-nav ul li a {
    color: var(--color-text-muted);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    text-decoration: none;
    transition: color 120ms var(--ease-out);
}

.footer-nav .menu li a:hover,
.footer-nav ul li a:hover { color: var(--color-text); }

@media (max-width: 560px) {
    .footer-nav .menu,
    .footer-nav ul { gap: var(--sp-3) var(--sp-4); }
    .footer-nav .menu > li,
    .footer-nav ul > li { gap: var(--sp-4); }
}

/* ============================================
   Yoast FAQ block → accordion styles
   (JS transforms DOM; before JS runs, questions and answers are fully visible)
   ============================================ */

/* Base block constraints — JS adds .faq-list which overrides */
.wp-block-yoast-faq-block {
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
}

/* Fallback pre-JS: style the raw Yoast output readably */
.wp-block-yoast-faq-block:not(.faq-ready) .schema-faq-section {
    border-bottom: 1px solid var(--color-border);
    padding: var(--sp-5) 0;
}

.wp-block-yoast-faq-block:not(.faq-ready) .schema-faq-question {
    display: block;
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    margin-bottom: var(--sp-3);
    color: var(--color-text);
}

.wp-block-yoast-faq-block:not(.faq-ready) .schema-faq-answer {
    color: var(--color-text-muted);
    line-height: var(--lh-loose);
}

/* After JS transforms and adds .faq-ready — accordion CSS from faq-home.css takes over */

/* ============================================
   Prose content — WordPress block editor output
   (applied when content is in .home-prose or .prose)
   ============================================ */

/* Ensure Gutenberg alignment classes work */
.home-prose .wp-block-image img,
.prose .wp-block-image img {
    border-radius: var(--r-md);
    max-width: 100%;
    height: auto;
}

.home-prose .wp-block-group,
.home-prose .wp-block-columns {
    margin-top: var(--sp-5);
}

/* Reset figure.wp-block-table — override WP block styles which inject border:1px solid (black) */
.prose figure.wp-block-table,
.home-prose figure.wp-block-table {
    margin: 0 !important;
    overflow: visible !important;
}
.prose figure.wp-block-table .table-wrap,
.home-prose figure.wp-block-table .table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-xs);
    margin: var(--sp-5) 0;
}
.prose figure.wp-block-table table,
.home-prose figure.wp-block-table table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: var(--fs-sm);
    background: var(--color-bg);
    border: none !important;
}
.prose figure.wp-block-table th,
.prose figure.wp-block-table td,
.home-prose figure.wp-block-table th,
.home-prose figure.wp-block-table td {
    text-align: left !important;
    padding: 14px 18px !important;
    border: none !important;
    border-bottom: 1px solid var(--color-border) !important;
    vertical-align: top;
}
.prose figure.wp-block-table th,
.home-prose figure.wp-block-table th {
    font-weight: var(--fw-bold) !important;
    color: var(--color-text) !important;
    background: var(--color-surface) !important;
    font-size: var(--fs-xs) !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--color-border-strong) !important;
}
.prose figure.wp-block-table thead,
.home-prose figure.wp-block-table thead { border-bottom: none !important; }
.prose figure.wp-block-table tbody tr:hover,
.home-prose figure.wp-block-table tbody tr:hover { background: var(--color-surface); }
.prose figure.wp-block-table tr:last-child td,
.home-prose figure.wp-block-table tr:last-child td { border-bottom: none !important; }

/* ============================================
   Post thumbnail / featured image
   ============================================ */

.post-thumbnail {
    display: block;
    overflow: hidden;
    border-radius: var(--r-md);
    border: 1px solid var(--color-border);
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 300ms var(--ease-out);
}

.post-thumbnail:hover img { transform: scale(1.02); }

/* ============================================
   Archive / category post grid
   ============================================ */

.post-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-6);
}

@media (max-width: 920px) {
    .post-archive-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .post-archive-grid { grid-template-columns: 1fr; }
}

.post-card {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    text-decoration: none;
    color: inherit;
    transition: transform 140ms var(--ease-out);
}

.post-card:hover { transform: translateY(-2px); color: inherit; }
.post-card:hover .post-card-title { color: var(--color-accent); }
.post-card:hover .post-card-image { border-color: var(--color-border-strong); }

.post-card-image {
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
    aspect-ratio: 16 / 10;
    background: var(--color-surface-2);
    transition: border-color 140ms var(--ease-out);
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-card-image-placeholder {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        135deg,
        var(--color-surface) 0 12px,
        var(--color-surface-2) 12px 24px
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.post-card-title {
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    letter-spacing: -0.015em;
    line-height: 1.25;
    color: var(--color-text);
    margin: 0;
    transition: color 140ms var(--ease-out);
}

.post-card-excerpt {
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-muted);
    margin: 4px 0 6px;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
}

/* ============================================
   Review card — hub page
   ============================================ */

/* Override image size in review card */
.review-card-simple img,
.review-card-compact img {
    border-radius: var(--r-md);
    object-fit: cover;
}

/* ============================================
   Single review — post content area
   ============================================ */

.review-content-wrap {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--sp-8) var(--sp-5);
}

/* ============================================
   Pagination — WordPress paginate_links() output
   ============================================ */

.wp-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: var(--sp-8);
    padding-top: var(--sp-7);
    border-top: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.wp-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    border-radius: var(--r-md);
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all 120ms var(--ease-out);
}

.wp-pagination .page-numbers:hover:not(.current):not(.dots) {
    border-color: var(--color-text);
    color: var(--color-text);
}

.wp-pagination .page-numbers.current {
    background: var(--color-text);
    color: var(--color-bg);
    border-color: var(--color-text);
    cursor: default;
}

.wp-pagination .page-numbers.dots {
    border: 0;
    background: none;
    cursor: default;
    color: var(--color-text-subtle);
}

.wp-pagination .page-numbers.prev,
.wp-pagination .page-numbers.next {
    padding: 0 14px;
    gap: 6px;
}

/* ============================================
   Category label / eyebrow tag
   ============================================ */

.post-category-tag {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: var(--r-pill);
    background: var(--color-accent-soft);
    color: var(--color-accent);
    text-decoration: none;
    margin-bottom: var(--sp-4);
}

/* ============================================
   Last updated — review/article footer meta
   ============================================ */

.article-last-updated {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    padding-top: var(--sp-5);
    margin-top: var(--sp-7);
}

.article-last-updated strong { color: var(--color-text); font-weight: var(--fw-semibold); }

/* ============================================
   Review verdict — ensure proper display
   ============================================ */

.verdict-logo {
    width: 56px;
    height: 56px;
    border-radius: var(--r-md);
    object-fit: cover;
    flex-shrink: 0;
}

/* ============================================
   Sticky CTA — review single
   (layout.css handles the transform animation; .visible class added by JS)
   ============================================ */

/* The bar always exists in the DOM; layout.css slides it in/out with transform */

/* ============================================
   No results / empty states
   ============================================ */

.no-results {
    text-align: center;
    padding: var(--sp-9) var(--sp-5);
    color: var(--color-text-muted);
}

.no-results h2 { margin-bottom: var(--sp-4); }

/* ============================================
   Breadcrumb bar (below hero on all templates)
   ============================================ */

.breadcrumb-bar {
    text-align: center;
    margin: 10px 0;
}
.breadcrumb-bar .breadcrumb {
    display: inline-flex;
    justify-content: center;
}

/* ============================================
   Responsive tweaks
   ============================================ */

@media (max-width: 768px) {
    .review-hero-inner {
        grid-template-columns: 80px minmax(0, 1fr);
    }
    .review-hero-cta {
        grid-column: 1 / -1;
    }
    .verdict {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .verdict-brand { justify-content: center; }
    .verdict-cta { justify-content: center; }
}
