/*
 Theme Name:   Astra Child for Component Crate
 Theme URI:
 Description:  Child theme — separates "How to Choose" guides from review cards on category archives.
 Author:       Component Crate
 Template:     astra
 Version:      1.1.0
*/

/* Buyer's guide (full article inline on the parent category archive) */
.cc-buyers-guide-section {
    margin-bottom: 2.75rem;
}

.cc-buyers-guide {
    background: var(--card, #fff);
    border: 1px solid var(--border, #e1e4e8);
    border-left: 4px solid #f4d35e; /* Royal Gold */
    border-radius: 8px;
    padding: 1.75rem 2rem;
}

.cc-buyers-guide h1 {
    font-size: 1.8rem;
    margin: 0 0 1.25rem 0;
    line-height: 1.3;
    color: var(--foreground, #1f2328);
}

.cc-buyers-guide h1 a {
    color: inherit;
    text-decoration: none;
}

.cc-buyers-guide h2 {
    font-size: 1.45rem;
    margin: 2.2rem 0 0.9rem 0;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border, #e1e4e8);
    color: var(--foreground, #1f2328);
    line-height: 1.3;
}

.cc-buyers-guide h2:first-child {
    margin-top: 0;
}

.cc-buyers-guide p {
    line-height: 1.65;
    color: var(--muted-foreground, #656d76);
    margin: 0 0 1rem 0;
}

.cc-buyers-guide ul,
.cc-buyers-guide ol {
    margin: 0 0 1.1rem 0;
    padding-left: 1.4rem;
    color: var(--muted-foreground, #656d76);
    line-height: 1.6;
}

.cc-buyers-guide li {
    margin-bottom: 0.4rem;
}

.cc-buyers-guide li input[type="checkbox"] {
    margin-right: 0.45rem;
    accent-color: #f4d35e; /* Royal Gold */
    vertical-align: middle;
}

.cc-buyers-guide a {
    color: #0d3b66; /* Regal Navy */
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: rgba(244, 211, 94, 0.6); /* Sandy Gold underline */
    text-underline-offset: 2px;
}

.cc-buyers-guide a:hover {
    color: #1f2328;
    text-decoration-color: #f4d35e;
}

.cc-buyers-guide strong {
    color: var(--foreground, #1f2328);
}

.cc-buyers-guide table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0 1.5rem 0;
    font-size: 0.95rem;
}

.cc-buyers-guide th {
    background: #0d3b66; /* Regal Navy */
    color: #fff;
    text-align: left;
    padding: 0.6rem 0.8rem;
    font-weight: 600;
}

.cc-buyers-guide td {
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid var(--border, #e1e4e8);
    color: var(--muted-foreground, #656d76);
    vertical-align: top;
}

.cc-buyers-guide tr:nth-child(even) td {
    background: rgba(244, 211, 94, 0.06);
}

.cc-buyers-guide section {
    margin: 0;
}

/* guide hero (how-to guides on child categories) */
.cc-category-guide {
    margin-bottom: 2.75rem;
}

.cc-guide-hero {
    background: var(--card, #fff);
    border: 1px solid var(--border, #e1e4e8);
    border-left: 4px solid #f4d35e; /* Royal Gold */
    padding: 1.5rem 1.75rem;
    border-radius: 8px;
}

/* gap between two stacked identical guide heroes (e.g. the Processors
   archive shows the how-to guide + the dedicated gaming best-of guide) */
.cc-guide-hero + .cc-guide-hero {
    margin-top: 1.25rem;
}

.cc-guide-hero-title {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.cc-guide-hero-title a {
    color: var(--foreground, #1f2328);
    text-decoration: none;
}

.cc-guide-hero-title a:hover {
    text-decoration: underline;
}

.cc-guide-hero-excerpt {
    color: var(--muted-foreground, #656d76);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.cc-guide-hero-btn {
    display: inline-block;
    background: #f4d35e; /* Royal Gold */
    padding: 0.6rem 1.3rem;
    border-radius: 6px;
    color: #0d3b66; /* Regal Navy text */
    text-decoration: none;
    font-weight: 600;
    transition: opacity .15s ease;
}

.cc-guide-hero-btn:hover {
    opacity: .9;
}

/* review cards container */
.cc-category-reviews {
    margin-top: 3.5rem;
}

.cc-category-reviews .cc-reviews-heading {
    font-size: 1.4rem;
    margin-bottom: 1.25rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border, #e1e4e8);
}

.cc-review-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.cc-review-card {
    background: var(--card, #fff);
    border: 1px solid var(--border, #e1e4e8);
    border-left: 4px solid #f4d35e; /* Royal Gold */
    border-radius: 8px;
    padding: 1.4rem 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.cc-review-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

.cc-review-card h3 {
    font-size: 1.15rem;
    margin: 0 0 .65rem 0;
    line-height: 1.4;
}

.cc-review-card h3 a {
    color: var(--foreground, #1f2328);
    text-decoration: none;
}

.cc-review-card h3 a:hover {
    text-decoration: underline;
}

.cc-review-card p {
    color: var(--muted-foreground, #656d76);
    font-size: .95rem;
    line-height: 1.55;
    margin: 0 0 .9rem 0;
    flex-grow: 1;
}

.cc-review-card p strong {
    color: var(--foreground, #1f2328);
}

.cc-review-card a strong {
    color: #f4d35e; /* Royal Gold */
}

/* match existing .cc-review-card styling on hub pages */
@media (max-width: 780px) {
    .cc-review-cards {
        grid-template-columns: 1fr;
    }
}

/* Full-width category layout overrides removed — sidebar enabled on category pages */

/* Category pages with sidebar: posts should be full-width within #primary,
   not 33.33% (which makes them ~6cm wide when inside a 75%-width #primary) */
.ast-separate-container.ast-two-container.ast-right-sidebar .ast-blog-layout-4-grid .ast-article-post,
.ast-separate-container.ast-two-container.ast-left-sidebar .ast-blog-layout-4-grid .ast-article-post {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

/* Also remove padding that ast-separate-container adds to the grid posts */
.ast-separate-container .ast-blog-layout-4-grid .ast-article-post {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* === FAQ Block === */
.cc-faq-block {
    background: var(--card, #fff);
    border: 1px solid var(--border, #e1e4e8);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.cc-faq-heading {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border, #e1e4e8);
    color: var(--foreground, #1f2328);
}

.cc-faq-item {
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border, #e1e4e8);
}

.cc-faq-item:last-child {
    border-bottom: none;
}

.cc-faq-question {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--foreground, #1f2328);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cc-faq-question:hover {
    background: rgba(244, 211, 94, 0.10); /* Royal Gold 10% */
    color: var(--foreground, #1f2328);
}

.cc-faq-toggle {
    font-size: 1.3rem;
    color: var(--muted-foreground, #656d76);
    transition: transform 0.2s ease;
}

.cc-faq-question[aria-expanded="true"] .cc-faq-toggle {
    transform: rotate(180deg);
}

.cc-faq-answer {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--muted-foreground, #656d76);
    display: none;
}

.cc-faq-answer p {
    margin: 0 0 0.75rem 0;
}

.cc-faq-answer p:last-child {
    margin-bottom: 0;
}

/* === HowTo Block === */
.cc-howto-block {
    background: var(--card, #fff);
    border: 1px solid var(--border, #e1e4e8);
    border-left: 4px solid #f4d35e; /* Royal Gold */
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
}

.cc-howto-heading {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    color: var(--foreground, #1f2328);
}

.cc-howto-desc {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--muted-foreground, #656d76);
    margin-bottom: 1.25rem;
}

.cc-howto-steps {
    counter-reset: cc-howto-step;
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem 0;
}

.cc-howto-step {
    counter-increment: cc-howto-step;
    padding: 0.6rem 0 0.6rem 3rem;
    position: relative;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--muted-foreground, #656d76);
}

.cc-howto-step::before {
    content: counter(cc-howto-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: #f4d35e; /* Royal Gold */
    color: #0d3b66; /* Regal Navy for contrast */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.cc-howto-step::after {
    content: '';
    position: absolute;
    left: 1rem;
    top: 2rem;
    bottom: -0.5rem;
    width: 2px;
    background: var(--border, #e1e4e8);
}

.cc-howto-step:last-child::after {
    display: none;
}

.cc-howto-disclosure {
    font-size: 0.85rem;
    color: var(--muted-foreground, #656d76);
    font-style: italic;
}

/* === Rating Block === */
.cc-rating-block {
    display: inline-block;
    margin: 1rem 0;
}

.cc-rating-block a {
    text-decoration: none;
    color: #f4d35e; /* Royal Gold */
    font-weight: 500;
}

.cc-stars {
    color: #f59e0b;
    font-weight: 700;
    margin-right: 0.25rem;
}

/* === External image consent (banner + control) === */
/* External product images (m.media-amazon.com / www.keychron.com) are
   delivered as local SVG placeholders in src + real URL in data-src; the
   CDN is only contacted after the visitor chooses "Load product images".
   No blocking CSS is needed — placeholders are already local. */

/* Banner */
#cc-consent-banner {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 99990;
    background: #ffffff;
    border-top: 2px solid #1f2937;
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.18);
    font-family: 'Space Grotesk', system-ui, sans-serif;
    padding: 1rem 1.25rem;
}
.cc-consent-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
}
.cc-consent-text {
    flex: 1 1 320px;
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #111827;
}
.cc-consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.cc-btn {
    font: inherit;
    font-size: 0.9rem;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #111827;
    cursor: pointer;
}
.cc-btn:hover { background: #f1f5f9; }
.cc-btn-primary {
    background: #111827;
    border-color: #111827;
    color: #ffffff;
}
.cc-btn-primary:hover { background: #1f2937; }

/* Persistent control pill (bottom-right, above the banner) */
.cc-img-control {
    position: fixed;
    right: 1rem;
    bottom: 5.25rem; /* above the banner when it is open */
    z-index: 99991;
    font: inherit;
    font-size: 0.82rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #111827;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.15);
}
.cc-img-control:hover { background: #f1f5f9; }
.cc-img-granted { border-color: #16a34a; color: #166534; }
.cc-img-denied { border-color: #dc2626; color: #991b1b; }

/* Back-to-top button: lift it above the Netlify free-plan badge (fixed
   bottom-right, ~64px tall incl. inset) AND the cc-img-control consent
   pill (bottom 84px + ~36px tall ≈ 120px). 140px clears both with margin. */
#ast-scroll-top.ast-scroll-to-top-right {
    bottom: 140px;
}

/* Archive affiliate disclosure (before first affiliate link) */
.cc-arch-disclosure {
    margin: 0 0 1.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #111827;
    background: #f8fafc;
    font-size: 0.85rem;
    line-height: 1.55;
    color: #334155;
}
.cc-arch-disclosure a { color: #111827; font-weight: 500; }

/* Footer: Amazon line + copyright left, legal menu right */
.cc-footer-affiliate {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 0.25rem;
}
.cc-footer-affiliate a { color: #64748b; }

/* Astra ships the below-footer row as one full-width column ("stack"), which
   put the vertical menu under the copyright. Make it two columns on desktop:
   [affiliate line + copyright] ....... [vertical legal menu, right-aligned]. */
@media (min-width: 922px) {
    .site-below-footer-wrap[data-section="section-below-footer-builder"] .ast-builder-grid-row {
        grid-template-columns: 1fr auto;
    }
    /* section-1 is a flex row by default (affiliate | links | copyright) */
    .site-below-footer-wrap[data-section="section-below-footer-builder"]
        .site-footer-below-section-1 .ast-footer-copyright.ast-builder-layout-element {
        display: block;
        text-align: left;
    }
    .site-below-footer-wrap[data-section="section-below-footer-builder"]
        .site-footer-below-section-1 .ast-footer-copyright { text-align: left; }
    .site-below-footer-wrap[data-section="section-below-footer-builder"] .site-footer-section {
        margin-bottom: 0;
    }
}

/* Vertical legal menu (#astra-footer-menu) — right-aligned column of links */
.footer-nav-wrap { width: 100%; }
#astra-footer-menu.astra-footer-vertical-menu {
    display: grid;
    justify-content: end;
    gap: 0.15rem;
}
#astra-footer-menu.astra-footer-vertical-menu .menu-item > a {
    padding: 0;
    font-size: 0.78rem;
    color: #64748b;
}
#astra-footer-menu.astra-footer-vertical-menu .menu-item > a:hover {
    color: #111827;
    text-decoration: underline;
}
@media (max-width: 921px) {
    #astra-footer-menu.astra-footer-vertical-menu { justify-content: start; }
    .site-below-footer-wrap[data-section="section-below-footer-builder"]
        .site-footer-below-section-1 .ast-footer-copyright.ast-builder-layout-element,
    .site-below-footer-wrap[data-section="section-below-footer-builder"]
        .site-footer-below-section-1 .ast-footer-copyright { text-align: center; }
}

/* Clean 404 */
.cc-404-clean h2 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.cc-404-clean p { color: #475569; }
.cc-404-links { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.cc-404-links a { color: #111827; font-weight: 500; }

/* Build Your Own PC traffic page: component list (40%) + demo video (60%). */
.cc-builder-parts-demo {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 1.5rem;
    align-items: center;
    margin: 1rem 0 1.75rem;
}
.cc-builder-parts-list > p:first-child { margin-top: 0; }
.cc-builder-parts-list ol { margin-bottom: 0; }
.cc-builder-demo-video { margin: 0; }
.cc-builder-demo-video video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}
@media (max-width: 781px) {
    .cc-builder-parts-demo {
        grid-template-columns: 1fr;
        gap: 1rem;
        align-items: start;
    }
}


